My ActivityBot Diagnostic
Rsadeika
Posts: 3,837
Below is the start of a diagnostic program for the ActivityBot. So far I only have two tests, the abcalibrate, and a remote controller. The remote program is the one Andy provided to test the keys, and get the number for the key. Also the abcalibrate is the existing program that is found in the lib file.
The ABdiag program, for the 'remote' command has a terminal screen problem that I do not know how to fix. When I use the "CRSRY,1" combination, it is not placing the cursor where I was expecting. I would like to have everything appear right below the "print("%c Press 'Power' on remote to quit.\n",CLS);" statement, not sure how fix this.
I have not commented the program at all, just want to make sure the concept is something people would use.
Ray
The ABdiag program, for the 'remote' command has a terminal screen problem that I do not know how to fix. When I use the "CRSRY,1" combination, it is not placing the cursor where I was expecting. I would like to have everything appear right below the "print("%c Press 'Power' on remote to quit.\n",CLS);" statement, not sure how fix this.
I have not commented the program at all, just want to make sure the concept is something people would use.
Ray
Comments
Ray
For battery monitoring, try this:
Take an unused pair of servo ports, like P16 and P17, and set the power jumper for that pair to VIN.
Run a socket to pin jumper from the center pin of either the P16 or P17 port to an unused row on the breadbaord.
Connect two 10 k resistors in series (end to end) from GND to the VIN row you created on the on the breadbaord.
The row where the two series resistors are connected together should have half of the VIN voltage. Check with a voltmeter.
After using a voltmeter to verify that the voltage at the node where the series resistors meet is 1/2 VIN, connect a jumper wire from that half voltage row to A/D3.
Start with the Measure Volts project from http://learn.parallax.com/propeller-c-simple-circuits/measure-volts. Modify it to display just v3. You could also multiply v3 by 2 so that it displays the actual battery voltage.
The Lion pack docs will probably have some info on when the batteries are tired. As for the 5-cell alkaline pack, I'd say test if your ActivityBot continues performing down to 6 V.
You'll probably want to make your code take an average of voltages. Avoid taking voltage measurements during direction changes because battery voltage will dip briefly, but significantly during those maneuvers.
Andy
Next in line will be the battery charge state function, I was trying to do this before with no luck, I hope I have a better outcome this time. If and when I get the battery thing working, that should provide enough basic information about the ActivityBot.
The only thing that I have to think about now is, making the program a little smarter, for instance - what if one of the devices is bad, does the function lock-up? Or what if one of the devices is not hooked up, how does the program convey that information? Just small stuff like that ...
Ray
menu - shows the menu
quit - quits the program
calibrate - does the servo calibration program
remote - shows the key code numbers on keypress
servos - tests the servo drives
ping - checks the ping)))
battery - shows the state of battery charge
There is still something wrong with the remote function as it is displayed, cannot figure that one out. You can use this program to check the state of your ActivityBot to see if everything is working as expected, and whatever else you want to use it for.
Since there are a lot of other devices that can be used with the ActivityBot, I am not sure how I will deal with those.
Ray