• Bluetooth Arduino LED 1
  • Bluetooth Arduino LED 2

Bluetooth Arduino LED

Controlando o Arduino via Bluetooth, você pode ligar e desligar um led

Os dados que envia a APP

Pin verde "Power" = 'h'
Botão Vermelho "Off" = 'l'

Links Pin = Isso seleciona o módulo Bluetooth para ser conectado e / ou sincronizar

Como exemplo usará a 13 e GND; Botorn vestuário com interruptor botão verde e vermelho com

// HOME
Liderados int = 13;
int Status = 0;

void setup () {
Serial.begin (9600);
pinMode (LED, OUTPUT);
}

void loop () {
se (Serial.available ()! = 0) {
Status = Serial.read ();
}
if (estado == 'h') {
digitalWrite (LED, HIGH);
}
if (estado == 'l') {
digitalWrite (LED, LOW);
}
}
// FIM

Mais Manuais http://manual.netandino.net

Categoria : Educação

Pesquisas associadas