#include "ReelTwo.h"
#include "core/PushButton.h"
#include "ServoDispatchDirect.h"
#define NEXT_BUTTON_PIN A0
const ServoSettings servoSettings[] PROGMEM = {
{ 2, 2200, 800, 0 }, /* 0: my servo */
};
ServoDispatchDirect<SizeOfArray(servoSettings)> servoDispatch(servoSettings);
PushButton pushButton(NEXT_BUTTON_PIN);
void setup()
{
REELTWO_READY();
SetupEvent::ready();
// Attach function openServo to pushButton
pushButton.attachClick(openServo);
}
void openServo()
{
// Move servo#0 to 100% over 2000ms
servoDispatch.moveTo(0, 2000, 1.0);
}
void loop()
{
AnimatedEvent::process();
}