Upload New File

parent 7aac88bf
#include <SoftwareSerial.h>
SoftwareSerial miBT(10, 11);
char DATO=0;
int LEDROJO=2;
int LEDVERDE=3;
void setup() {
miBT.begin(38400);
pinMode(LEDROJO, OUTPUT);
pinMode(LEDVERDE, OUTPUT);
}
void loop() {
if (miBT.available()){
DATO=miBT.read();
if (DATO=='1')
digitalWrite(LEDROJO, !digitalRead(LEDROJO));
if(DATO=='2')
digitalWrite(LEDVERDE, !digitalRead(LEDROJO));
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment