🛠️ Dive into our collection of DIY Kits, 🔊 Audio Amplifiers, Digital Scoreboards, FM transmitters, and more!
🎶 Explore endless possibilities at our new store.


Sketch- Test Amarino

Get the sketch: https://gist.github.com/buildcircuit/3939682

/*
Receives Test Events from your phone.
After it gets a test message the led 11 will blink
for one second.
*/
#include <MeetAndroid.h>
MeetAndroid meetAndroid;
int onboardLed = 11;
void setup()
{
Serial.begin(9600);
// register callback functions, which will be called when an associated event occurs.
// - the first parameter is the name of your function (see below)
// - match the second parameter ('A', 'B', 'a', etc...) with the flag on your Android application
meetAndroid.registerFunction(testEvent, 'A');
pinMode(onboardLed, OUTPUT);
digitalWrite(onboardLed, HIGH);
}
void loop()
{
meetAndroid.receive(); // you need to keep this in your loop() to receive events
}
/*
* This method is called constantly.
* note: flag is in this case 'A' and numOfValues is 0 (since test event doesn't send any data)
*/
void testEvent(byte flag, byte numOfValues)
{
flushLed(300);
flushLed(300);
}
void flushLed(int time)
{
digitalWrite(onboardLed, LOW);
delay(time);
digitalWrite(onboardLed, HIGH);
delay(time);
}


🛠️ Dive into our collection of DIY Kits, 🔊 Audio Amplifiers, Digital Scoreboards, FM transmitters, and more!
🎶 Explore endless possibilities at our new store.


Leave a Reply

Your email address will not be published. Required fields are marked *