#include SoftwareSerial mySerial(3, 8); const int buttonPin = 7; const int ledPin = 2; // variables will change: int buttonState = 0; void setup() { mySerial.begin(9600); mySerial.println("Hello, world"); // initialize the LED pin as an output: pinMode(ledPin, OUTPUT); // initialize the pushbutton pin as an input: pinMode(buttonPin, INPUT); //Set the pull up resistor digitalWrite(buttonPin, HIGH); } void loop() { buttonState = digitalRead(buttonPin); if (buttonState == HIGH) { digitalWrite(ledPin, LOW); } else { digitalWrite(ledPin, HIGH); } mySerial.write("Hello from the loop"); }