Skip to content

Instantly share code, notes, and snippets.

@GiovanniBalestrieri
Created February 9, 2016 22:02
Show Gist options
  • Save GiovanniBalestrieri/3e940cec9067acab388d to your computer and use it in GitHub Desktop.
Save GiovanniBalestrieri/3e940cec9067acab388d to your computer and use it in GitHub Desktop.
void setup()
{
Serial.begin(115200);
}
void loop()
{
SerialRoutine();
}
void SerialRoutine()
{
//Read from usb serial to bluetooth
if(Serial.available())
{
char modeS = Serial.read();
if (modeS == 'a')
{
Serial.println(" TakeOff ");
}
if (modeS == 'L')
{
Serial.println(" Land ");
}
if (modeS == 'p')
{
Serial.println(" Pid ");
}
if (modeS == 't')
{
Serial.println("o,12,1,-4,");
}
if (modeS == 's')
{
Serial.println("c,p,");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment