Things used in this project

Hardware components:
Udooneo trasparent
UDOO NEO
×1
12577 01
SparkFun Bluetooth Modem - BlueSMiRF Silver
×1

Code

BluetoothArduino
UdooNeo or arduino compatible board. We send strings wtih a mobile to a bluetooth attached to pins 0 and 1
int ledPin[]={
  5,6,7,8,9,10,11,12 };

int pines = 8;
  
void setup(){
  Serial.begin(9600);  
  for (int thisPin = 0; thisPin < pines; thisPin++)  {
    pinMode(ledPin[thisPin], OUTPUT); 
    digitalWrite(ledPin[thisPin],0);  
  }
}
void loop(){
  char dato = Serial.read();
  if(dato == 'a'){
    digitalWrite(ledPin[0], HIGH);
    digitalWrite(ledPin[1], HIGH);
  }
  if(dato == 'b'){
    digitalWrite(ledPin[0], LOW);
    digitalWrite(ledPin[1], LOW);
  }
  if(dato == 'c')analogWrite(ledPin[2],255);
  if(dato == 'd')analogWrite(ledPin[3],255);
  if(dato == 'e')analogWrite(ledPin[4],255);
  if(dato == 'f'){
    for (int thisPin = 2; thisPin < 5; thisPin++){
    analogWrite(ledPin[thisPin],0);
    }
  }
  if(dato == 'g')analogWrite(ledPin[5],255);
  if(dato == 'h')analogWrite(ledPin[6],255);
  if(dato == 'i')analogWrite(ledPin[7],255);
  if(dato == 'j'){
    for (int thisPin = 5; thisPin < 8; thisPin++){
    analogWrite(ledPin[thisPin],0);
    }
  }
  if(dato == 'k'){
    analogWrite(ledPin[2],0);
    analogWrite(ledPin[5],0);
  }
  if(dato == 'l'){
    analogWrite(ledPin[3],0);
    analogWrite(ledPin[6],0);
  }
  if(dato == 'm'){
    analogWrite(ledPin[4],0);
    analogWrite(ledPin[7],0);
  }
   if(dato == 'n'){
    for (int thisPin = 2; thisPin < 7; thisPin++){
    analogWrite(ledPin[thisPin],255);
    delay(200);
    analogWrite(ledPin[thisPin],0);
    delay(200);
    }
    
  }
  delay(250);
  
 
}

Credits

791560f33a0ef1f109852e396396fdd8
Juan Carlos
8 projects • 6 followers
Contact

Replications

Did you replicate this project? Share it!

I made one

Love this project? Think it could be improved? Tell us what you think!

Give feedback

Comments

Add projectSign up / Login