mirror of
https://github.com/mytechnotalent/Embedded-Hacking.git
synced 2026-05-25 16:57:56 +02:00
36 lines
748 B
C
36 lines
748 B
C
#include <stdio.h>
|
|
#include <string.h>
|
|
#include "pico/stdlib.h"
|
|
#include "hardware/i2c.h"
|
|
#include "lcd_1602.h"
|
|
|
|
#define FAV_NUM 42
|
|
|
|
#define I2C_PORT i2c1
|
|
#define I2C_SDA_PIN 2
|
|
#define I2C_SCL_PIN 3
|
|
|
|
const int OTHER_FAV_NUM = 1337;
|
|
|
|
int main(void) {
|
|
stdio_init_all();
|
|
|
|
i2c_init(I2C_PORT, 100000);
|
|
gpio_set_function(I2C_SDA_PIN, GPIO_FUNC_I2C);
|
|
gpio_set_function(I2C_SCL_PIN, GPIO_FUNC_I2C);
|
|
gpio_pull_up(I2C_SDA_PIN);
|
|
gpio_pull_up(I2C_SCL_PIN);
|
|
|
|
lcd_i2c_init(I2C_PORT, 0x27, 4, 0x08);
|
|
|
|
lcd_set_cursor(0, 0);
|
|
lcd_puts("Reverse");
|
|
lcd_set_cursor(1, 0);
|
|
lcd_puts("Engineering");
|
|
|
|
while (true) {
|
|
printf("FAV_NUM: %d\r\n", FAV_NUM);
|
|
printf("OTHER_FAV_NUM: %d\r\n", OTHER_FAV_NUM);
|
|
}
|
|
}
|