Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
No That was me.... I was trying to make sense of the many posts... I juste deleted them all.. Sorry Burt!! But I was going mad.You deleted where I showed how to hook one up
#define rxPin 2
#define txPin 3
#define ledPin 7
#include <SoftwareSerial.h>
SoftwareSerial mySerial(rxPin, txPin);
int state = 0;
void setup() {
pinMode(rxPin, INPUT);
pinMode(txPin, OUTPUT);
pinMode(ledPin, OUTPUT);
digitalWrite(ledPin, LOW);
mySerial.begin(38400); // Default communication rate of the Bluetooth module
}
void loop() {
if(mySerial.available() > 0){ // Checks whether data is comming from the serial port
state = mySerial.read(); // Reads the data from the serial port
}
if (state == '0') {
digitalWrite(ledPin, LOW); // Turn LED OFF
mySerial.println("LED: OFF"); // Send back, to the phone, the String "LED: ON"
state = 0;
}
else if (state == '1') {
digitalWrite(ledPin, HIGH);
mySerial.println("LED: ON");;
state = 0;
}
}