roboBASIC v2.5 ============== action_proc ----------- action_proc gets a cmnd value +50 from a lower program, and then subtracts 50. roboRemocon from PC uses byte values of keys, does not depend on 50 "if you want to use this software then purchase it" 2nd line of 'Overall Template...' is FILL 255,10000 FILL is not in Manual - see DB manual Seemingly no way of sending values from the robot to the PC, or debuging values. '2006-07-09 robot_voltage: ' missing ENDIF before RETURN ' maximum AD(6) is 88 on fully charged battery ' not 148 as in original code Seemingly only way of determining maximum AD(6) value is to do a binary search until the error blinking doesn't happen. IF RR > 50 AND RR < 83 THEN GOTO action_proc 'this is the only call to action_proc: action_proc: falls through to RETURN if RR>82 but there is no where to RETURN to !!!!! falls through to first program - - see DB manual =========================================================================== Overall Tempate Program(Version 1.00 20051115).bas '---------------------- 'original robot_voltage: ' [ 10 x Value / 256 = Voltage] DIM v AS BYTE A = AD(6) IF A < 148 THEN ' 5.8v FOR v = 0 TO 2 OUT 52,1 DELAY 200 OUT 52,0 DELAY 200 NEXT v RETURN '---------------------- 'amended to work without divider resistors robot_voltage: ' [ 10 x Value / 256 = Voltage] DIM v AS BYTE A = AD(6) IF A < 80 THEN ' 148=5.8v FOR v = 0 TO 2 OUT 52,1 DELAY 200 OUT 52,0 DELAY 200 NEXT v endif RETURN ===========================================================================