Sensor Group's Function
Page 1 of 1
Sensor Group's Function
- Code:
//checks if a keystroke has occured(keystroke from rfid reader)
//if the keystroke indicates a hit from the rfid reader,
//call COMM group's function RoverDead()
void check_hit()
{
char c;
if( kbhit() ) //if keyboard input
{
c = getch();
switch(c)
{
case '{':
//first rover hit
RoverDead(TRUE);
break;
case '}':
//second rover hit
RoverDead(TRUE);
break;
default:
break;
}
}
}
There may need to be some new functionality for the RoverDead() function. As you can see we will be using separate keystrokes for each rover (to keep a rover from sensing its own darts) so there may need to be a way to report which rover was hit to RoverDead.
This function requires that the header files stdio.h and conio.h, which is included to run kbhit(), are included.
EDIT: Just to be clear, this is not an interrupt function, but rather a polling function. IT should be called once each time through the main loop.
kschuck- Posts : 2
Join date : 2009-01-11
Similar topics
» Sensor's, Post Your Schedules
» What is due next week?
» Groups and there members
» Rover Group and Sensor Group API and Stub code
» What is due next week?
» Groups and there members
» Rover Group and Sensor Group API and Stub code
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|