The diagram on the right is taken from the Handy Board's schematic list. TIC1 is a pin of the CPU (a M68HC11). The 47k resistor is to pull the normal control voltage up to +5v (read FALSE), as the output of the beacon is active low. When a beacon is detected, the control pin will be 0v (read TRUE). The beacon transmits in pulses - on for 1ms and off for 1ms repeatedly. The Handy Board will actually decode a valid Sony transmission (read on below). For other circuits you may be content to check for a change in the control signal from FALSE to TRUE and back. |
The sony-ir.icb file adds the capability of receiving infrared codes transmitted by a Sony remote, or a universal remote programmed to transmit Sony infrared codes.
The infrared sensor is the dark green component in the Handy Board's lower right hand corner.
Basically my "main" from the robot code that used the beacon to start went like this:
void main() { int pid1, pid2; sony_init(1); while(1) { beep(); /* Wait for start IR signal */ while(!ir_data(1)); /* Perform sumo behaviour */ pid1=start_process(arbitrate()); pid2=start_process(motor_module()); /* Wait for stop button */ while(!stop_button()); while(stop_button()); /* Kill processes */ kill_process(pid1); kill_process(pid2); rest(); } }
Don't forget to load the sony-ir.icb file - either load it manually each time with "load [path]/sony-ir.icb" at the IC prompt, or add it to the "lib_hb.lis" file that comes with IC, so that it will be loaded each time IC starts.