4. First Step - setup
Initialise serial port
Define seven output pins , set them low
Define array with seven element, clear
all elements (put 0 there)
5. Second Step - Loop
Wait for serial data
Subtract Ascii code of ‘1’. if Value is 0 to
6. This is ‘I’, else display error message.
Toggle array element I
If new value is 00, Switch off output I,
else switch on output I
Display appropriate message on serial
port
6. Next step
Add LCD, IR
Display status of all seven outputs at
power on on LCD
When IR code is pressed, change output
and LCD Display.
7. Small Trick
Some students find it diffult to
understand how to toggle a output.
It is like this. When we press a key, we
change one Variable by exclusive oring
with Binary 1. So if it was ‘0’ after
pressing key it becomes ‘1’
Now we check variable, if ‘0’ we set
output off, if ‘1’ we set output on.
8. For More Details
Join facebook.com/open.embedded
All data sheets and soruce code
available http://bit.ly/9Scf5j