KENNY TAX SERVICES: PAY WITH YOUR REFUND, GET YOUR REFUND DIRECT DEPOSIT, FREE ESTIMATES, NO APPOINTMENTS NEEDED. OTHERS SERVICES: CELL PHONES / VENTAS DE CELULARES, PAY BILLS / PAGO DE BILLS, SEND MONEY / ENVIO DE DINERO, SHIPPING / ENVIO DE CAJAS. CALL OR VISIT US: 510 ARMORY ST. SPRINGFIELD, MA 01104 TELL. (413) 214-6136 FAX (413) 214-6133 EMAIL: KENNYTRAVEL12@YAHOO.COM

ARDUINO BLUETOOTH, BLUETOOTH BLINK

//www.elegoo.com
//2016.09.19

int LED=13;//Define 13 pin for LED
volatile int state = LOW;//The initial state of the function is defined as a low level
char getstr; //Defines a function that receives the Bluetooth character
void setup() {
pinMode(LED, OUTPUT);
Serial.begin(9600);
}
/*Control LED sub function*/
void stateChange()
{
state = !state;
digitalWrite(LED, state);
}
void loop() {
getstr=Serial.read();//The Bluetooth serial port to receive the data in the function
if(getstr==’A’){
stateChange();
}
}

Valoraciones

No hay valoraciones aún.

Sé el primero en valorar “ARDUINO BLUETOOTH, BLUETOOTH BLINK”