Posts

Android Arduino app and code for controlling RGB LED

Android Arduino app and code for controlling RGB LED Circuit Diagram : Arduino Program : #include <SoftwareSerial.h> SoftwareSerial BT(10, 11); //TX, RX respetively String color; void setup() {  BT.begin(9600);  Serial.begin(9600);   pinMode(2, OUTPUT); // blue   pinMode(3, OUTPUT); // green   pinMode(4, OUTPUT); // red } //-----------------------------------------------------------------------//  void loop() {   while (BT.available()){  //Check if there is an available byte to read   delay(10); //Delay added to make thing stable   char c = BT.read(); //Conduct a serial read   color += c; //build the string- "blue, red and green"   }    if (color.length() > 0) {     Serial.println(color);   if(color == "blue")   {     digitalWrite(2, HIGH);     digitalWrite (3, LOW);     digitalWrite(4,LOW);...
Recent posts