Closed doublesharp closed 9 years ago
for now, i need the motor dance at startup (and at radio connect) to make sure everything is working. we theoretically could move to an led or a piezo buzzer in the future, but this works as an easy way to verify that all the connections are good (the radio, the board-to-board, all the way throught the wires to the motors)
Agreed, and this pull request was actually buggy (I closed it and will again). I got my Arduino environment fully set up so that I can talk to it via BT from the VM (hooked it up to a 3cell battery pack before I realized that it can run via USB power when the serial is opened) and was able to correct the start up check (but in a way that is better for the motors), cleaned up the code, turned down the clock a bit (for more power savings), plus some other stuff. Since I don't have motors/ESC's to hook up to it I am going to leave the Arduino code in my own fork until I can test it (or someone else wants to drop it on their more complete setup), see: https://github.com/doublesharp/hindenburgFights/blob/master/rfduino_bleMotorControl/rfduino_bleMotorControl.ino.
Here is the serial log from the startup sequence on mine:
DVR8830 Motor Controller
BluetoothLE MAC Address 9
Test motors
Back clearFault(97) wire status: 2
Front clearFault(100) wire status: 2
Bottom clearFault(103) wire status: 2
Back setForward(97) wire status: 2
Back setBrake(97) wire status: 2
Back setReverse(97) wire status: 2
Back setBrake(97) wire status: 2
Front setForward(100) wire status: 2
Front setBrake(100) wire status: 2
Front setReverse(100) wire status: 2
Front setBrake(100) wire status: 2
Bottom setForward(103) wire status: 2
Bottom setBrake(103) wire status: 2
Bottom setReverse(103) wire status: 2
Bottom setBrake(103) wire status: 2
Ready to go!
RFduinoBLE_onConnect
Back setForward(97) wire status: 2
Front setForward(100) wire status: 2
Bottom setForward(103) wire status: 2
Back setBrake(97) wire status: 2
Front setBrake(100) wire status: 2
Bottom setBrake(103) wire status: 2
I DID NOT TEST THIS CODE. I don't have a battery. But I did clean it up a lot and it will verify and load to the RFDuino. If someone can test this on a working blimp setup it might be worth accepting the merge.
Store motor GPIO values in an array. Refactor startup code to put less stress on the motors/battery (forward,stop,reverse,stop). Put device into low power mode. Added convenience method to run commands on all motors at once. Grouped event handling methods.