Hackster will be offline on Friday, March 1 from 9pm to 10pm PST to perform some scheduled maintenance.
Juan Carlos
Published © GPL3+

Udoo Neo External Bluetooth

Easy way to connect Neo with a mobile programming with AppInventor.

IntermediateFull instructions provided3 hours1,210
Udoo Neo External Bluetooth

Things used in this project

Story

Read more

Code

Bluetooth

Arduino
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

Juan Carlos

Juan Carlos

8 projects • 9 followers

Comments