Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


Share this Page URL
Help

The Flight > Evaluating Cost - Pg. 207

Capturing Inputs // mailbox volatile char KBDReady; volatile char KBDCode; 207 Package it all together in a file that we will call PS2CN.c. The include file is the same was used in the previous example (PS2.h) since we are going to offer the same interface. Similar considerations apply to the test program; PS2Test.c can be re-used in this new instance. So all we have to do is to create a new project, called 11-PS2CN, and add the same source and header files used in 11-PS2IC while replacing only the PS2IC.c file with the new PS2CN.c implementation. Launch the project using the Run>Run Project command and verify that the same key codes (seen in the previous exercise) appear on the row of LEDs connected to PORTA. Note Similarly to the previous case, you might want to add a timeout mechanism to handle