beautypg.com

Wavetronix Click 500 (programmable controller) (CLK-500) - Developer Guide User Manual

Page 100

background image

CHAPTER 9 • DIGITAL INPUT/OUTPUT 99

///////////////////////////////////////////////////////////////
// ExampleCode9.1.C
///////////////////////////////////////////////////////////////
#use click500menu.lib
#use click500timer.lib
#use click500digitalIO.lib

#define EXAMPLE_9_1

#define GREEN_INDICATION 0
#define YELLOW_INDICATION 1
#define RED_INDICATION 2
#define DUAL_INDICATION 3

#define TIME_GREEN_MS 5000
#define TIME_YELLOW_MS 5000
#define TIME_RED_MS 5000

#define INPUT_OFF 0
#define INPUT_ON 1

#define REQUIRED_ISR_TICK_COUNT 3

ClickUtilTimer SignalLightTimer;
char SignalLightState;
char Input1Red;
char Input2Yellow;

void Mode1( void );
void Setup1( void );
void ChangeSignalLight( void );
void MonitorSignalLight( void );
char ReadInputs( void );
void FilterInputs( void );

void main( void )
{
ClickMenuAddMode( Mode1, Setup1, BLUE, 0, 0);
ClickMenuStart();
}

void Mode1( void )