#include const int buttonPin = PA7; const int redLedPin = PA3; const int greenLedPin = PB2; int buttonState = 0; SoftwareSerial Serial(PA0, PA1); // RX, TX void setup() { Serial.begin(9600); // setting the LEDs to outputs and the button to output pinMode(redLedPin, OUTPUT); pinMode(greenLedPin, OUTPUT); pinMode(buttonPin, INPUT_PULLUP); } void loop() { buttonState = digitalRead(buttonPin); if (buttonState == LOW) { digitalWrite(redLedPin, HIGH); Serial.print("The red LED is on"); } else { // turn LED off: digitalWrite(redLedPin, LOW); } }