KURT2SAM: a Sample Control Panel for KURT2
Objective
There is a project workspace kurt2sam.dsw in the directory kurt2sam, which can be opened with Visual C++ 6.0. The included source files may be compiled and linked to a sample application in several variants named K2SAMxxx.EXE, depending on the type of CAN interface to be used.
Functionality of K2SAMxxx.EXE
The software provides a control panel for KURT2 using most of the functions provided by the Win32 library KURT2xxx.DLL.
The main part of the screen displays the current values of all the sensors attached to the main microcontroller:
- Sonar 0 - Sonar 9
- Tilt sensor value1 and value2
- Bumper 0 - Bumper 5
- Compass curve1 and curve2
- RC Button 0 - RC Button 7
- Current left and right
- Encoder left and right
Also the current control settings for the motors are displayed:
- Speed left and right
- Pulse width modulation left and right
- Direction left and right
- Brake left and right
Below this part, the current values of the 16 analog sensors attached to the optional second microcontroller are displayed in two lines.
The user's keystrokes are reflected at the command line. Possible commands are listed in the last line of the screen:
- Letter l or r followed by a positive or negative decimal value between -1024 and 1024 means to set left or right motor to the respective value, where "+" results in forward motion and "-" in the opposite.
- Capital letter L or R followed by a positive or negative decimal value between -100 and +100 means to set the speed of the left or right motor to the respective percentage, where ""+" results in forward motion and "-" in the opposite.
- An empty input line, i.e. only pressing the return key, immediately stops all motors.
- Letter t toggles trace mode. In trace mode the system's state is logged frequently in the file kurt2.log.
- Letter q quits the program.
Certain messages, e.g. errors, are eventually displayed in the line below the command line.
$Id: kurt2sam.htm,v 1.2 2002/03/13 12:30:51 worst Exp $