/* * doorbell.c * * Created on: Feb 6, 2015 * Author: Paul Bunt * * this is a prototype program for a doorbell using the intel edison */ #include #include //#include #include #include #include #include "pins.h" #include "mail.h" #define BUTTON 8 #define LED 13 #define BUZZER 5 char EMAIL[] = "youremail@example.com"; int main(){ //running bool bool running = true; bool tripped = false; // loop for interrupt do{ bool pressed = PinActive(BUTTON); if (pressed){ PinPulse(LED,100); PinPulse(BUZZER,100); if(!tripped){ send_mail(EMAIL, "Doorbell!"); tripped = true; } } else { tripped = false; } }while(running); }