Attiny_85_84_Serial_comm/Attiny_84_Slave.ino

27 lines
374 B
Arduino
Raw Normal View History

2024-10-26 00:54:07 +02:00
#include <SoftwareSerial.h>
SoftwareSerial mySerial(3,NULL); //RX, TX
uint8_t blueLED = 10;
uint8_t v;
void setup() {
mySerial.begin(9600);
pinMode(blueLED, OUTPUT);
//pinMode(PB0, INPUT);
digitalWrite(blueLED, LOW);
}
void loop() {
v = mySerial.read();
if (v == '1')
digitalWrite(blueLED, HIGH);
if (v == '2')
digitalWrite(blueLED, LOW);
}