#include <Servo.h>
#include "talkie.h"
Talkie voice;
int8_t spDANGER[] PROGMEM = {0x2D, 0xBF, 0x21, 0x92, 0x59, 0xB4, 0x9F, 0xA2, 0x87, 0x10, 0x8E, 0xDC, 0x72, 0xAB, 0x5B, 0x9D, 0x62, 0xA6, 0x42, 0x9E, 0x9C, 0xB8, 0xB3, 0x95, 0x0D, 0xAF, 0x14, 0x15, 0xA5, 0x47, 0xDE, 0x1D, 0x7A, 0x78, 0x3A, 0x49, 0x65, 0x55, 0xD0, 0x5E, 0xAE, 0x3A, 0xB5, 0x53, 0x93, 0x88, 0x65, 0xE2, 0x00, 0xEC, 0x9A, 0xEA, 0x80, 0x65, 0x82, 0xC7, 0xD8, 0x63, 0x0A, 0x9A, 0x65, 0x5D, 0x53, 0xC9, 0x49, 0x5C, 0xE1, 0x7D, 0x2F, 0x73, 0x2F, 0x47, 0x59, 0xC2, 0xDE, 0x9A, 0x27, 0x5F, 0xF1, 0x8B, 0xDF, 0xFF, 0x03};
Servo myservo;
int pos;
int Signal = 8;
void setup()
{
pinMode(Signal, INPUT);
myservo.attach(9);
}
void loop() {
int buttonState = digitalRead(Signal);
delay(1);
if (buttonState == 0)
{
for ( ;pos >= 40; pos -= 1)
{
myservo.write(pos);
delay(15);
}
}
else
{
for ( ;pos <= 180 ; pos += 1)
{
myservo.write(pos);
delay(5);
}
}
delay(10800);
voice.say(spDANGER);
voice.say(spDANGER);
voice.say(spDANGER);
}
Comments