|
Hi guys,
Thanks for your replies,
So basically if i have what Lleung and Bob said then it'd be something like:
enum AlarmStates { DISARMED, ARMED, ALERTED, ALARMING, CLEARED, UNKNOWN} SystemState;
SystemState = DISARMED;
while(forever)
{
GetAllSensors();
switch(SystemState)
{
case DISARMED:
Check Keys /// would that be something like, check if key input port pin is high; if (PRT1DR & 0x01) for example port 1.0 with fob input. if so,clear alarm output, which for example is port 1.1,
PRT1DR &= ~0X02; //make alarm output low
SystemState= ARMED
break;
With regards to inputting and outputting data, how is SystemState, Armed, disarmed related to actual inputs from the microcontroller?
thanks
BTW.. thanks for the C manual link Bob, ive added it to bookmarks
|