Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Test Amarino- Amarino Evaluation Shield
/*
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);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.