#include int ledPin = 8; // physical pin 5 on attiny44 int buttonApin = 7; // physical pin 6 on attiny44 int buttonBpin = 2; // physical pin 11 on attiny44 #define RX 0 // physical pin 13 on attiny44 #define TX 1 // physical pin 12 on attiny44 SoftwareSerial mySerial = SoftwareSerial(RX, TX); //SoftwareSerial Serial(RX, TX); void setup() { pinMode(ledPin, OUTPUT); pinMode(buttonApin, INPUT); pinMode(buttonBpin, INPUT); pinMode(RX, INPUT); pinMode(TX, OUTPUT); mySerial.begin(9600); } void loop() { mySerial.println("serial established."); delay(1000); // wait for a second if (digitalRead(buttonApin) == LOW) { digitalWrite(8, HIGH); // turn the LED on (HIGH is the voltage level) delay(500); // wait for a second digitalWrite(8, LOW); // turn the LED off by making the voltage LOW delay(500); // wait for a second mySerial.println("left button pressed"); delay(500); // wait for a second } else if (digitalRead(buttonBpin) == LOW) { digitalWrite(8, HIGH); // turn the LED on (HIGH is the voltage level) delay(1000); // wait for a second digitalWrite(8, LOW); // turn the LED off by making the voltage LOW delay(1000); // wait for a second mySerial.println("right button pressed"); delay(1000); // wait for a second } else if (mySerial.read()=='c') { digitalWrite(8, HIGH); // turn the LED on (HIGH is the voltage level) delay(50); // wait for a second digitalWrite(8, LOW); // turn the LED off by making the voltage LOW delay(50); // wait for a second mySerial.println('c'); delay(500); // wait for a second } else { //digitalWrite(8, HIGH); // turn the LED on (HIGH is the voltage level) //delay(50); // wait for a second digitalWrite(8, LOW); // turn the LED off by making the voltage LOW delay(50); // wait for a second mySerial.println("nothing pressed"); delay(500); // wait for a second } }