Escolar Documentos
Profissional Documentos
Cultura Documentos
Módulo Bluetooh
Módulo Bluetooh
#include <SoftwareSerial.h>
SoftwareSerial Bluetooth(2, 3); // 2-RX, 3-TX
char Comando;
void setup()
{
Bluetooth.begin(9600); // Estabelece Velocidade da comunicação
pinMode(13, OUTPUT);
}
void loop()
{
char Comando = Bluetooth.read(); // Leitura de dados do Bluetooth
Serial.println(Comando);
switch(Comando)
{
case 'F': { digitalWrite(13, HIGH); } break;
case 'B': { digitalWrite(13, LOW); } break;
} Digital 3
}
Digital 2