Skip to content

Instantly share code, notes, and snippets.

@abloom
Created February 24, 2012 22:59
Show Gist options
  • Select an option

  • Save abloom/1904391 to your computer and use it in GitHub Desktop.

Select an option

Save abloom/1904391 to your computer and use it in GitHub Desktop.
typedef struct {
String name;
void (*command)();
} Message;
void bellOn() {
digitalWrite(RING, HIGH);
}
void bellOff() {
digitalWrite(RING, LOW);
}
void longBell() {
bellOn();
delay(100);
bellOff();
}
void shortBell() {
bellOn();
delay(50);
bellOff();
}
const Message messages[] = {
{ name: "short", command: &shortBell },
{ name: "long", command: &longBell },
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment