#include <LiquidCrystal_I2C.h>
int button = PA6;
int led = PA5;
int sda = PA7;
int scl = PA9;
LiquidCrystal_I2C lcd(0x27, 16, 2);
void setup() {
// put your setup code here, to run once:
lcd.Serial(sda, scl);
Serial.begin(115200);
Serial.println("Hello, STM32!");
pinMode(button, INPUT);
pinMode(led, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
int buttonState = digitalRead(button);
if(buttonState == HIGH){
digitalWrite(led, HIGH);
} else {
digitalWrite(led, LOW);
}
}