After editing the code for a bit today, we finally figured out how to send commands through the android phone to the bluart. We tested this theory first by turning one of LEDs on the flora board on and off by sending the commands, "on" and "off" respectively through the android application blufruit LE.
Serial.print(F("[Recv] "));Serial.println(ble.buffer);
We replaced the line of code above, with the code below.
Serial.print(F("[Recv] "));Serial.println(ble.buffer);
We replaced the line of code above, with the code below.
if(test == "on"){
Serial.println(test);
digitalWrite(ledPin, HIGH);
}
if(test == "off"){
Serial.println(test);
digitalWrite(ledPin, LOW);
}
With this, we gave a value to the words on and off respectively, that allowed us to turn the LED on the flora on and off. Now we will try to figure out how to connect a motor to the bluefruit and the flora, so that we can use the android application to turn the motor on and off via bluetooth.
No comments:
Post a Comment