March 27, 2017 at 3:37 am #4106
I am working on a school project that is due within the next few days and I am having trouble with some things. I am working on an all-terrain robot that has a cargo hold on top where people are able to put, at the most 350lbs. We can use the RC mode fine, but we would like to be able to switch directly to Arduino and the PING))) sensors on the robot using the channel switch on our Spektrum DX5e Transmitter and Spektrum AR6110e receiver. I have bound the Arduino to the receiver and am able to read the signal the GEAR port and PIN 2 of the UNO. We decided to use a double integer to read the channel value and compare it to an if statement, set a bool statement true or false if this value is less that our set range.
Our problem right now is the PING))) sensors and the extensions not powering the sensors. I have the pins right and when I connect the sensors directly to the Arduino, they work fine. I have desoldered off two PING))) sensor transmitter modules to make them receivers like THE BEN HECK SHOW FOLLOW ME LUGGAGE and the back sensor is for safety and is not desoldered. I’m not sure what the problem is but it may be the way I wrote the code. We are using the Sabertooth 2×60 Motor controller by Dimension Engineering with the proper libraries. I have another PING))) Sensor on a sperate Arduino Board giving out a signal for the receivers to read. The extensions for the PING))) sensor hookups are around 42 inches long or less and are comprised of male to male, female to male and female to female wires.
I have labeled all the connections so I know my circuit is complete and the Arduino powers on from the serial connection and the Sabertooth when connected. We connect TX to S1 of the Sabertooth to give the commands to the motors using 0 to 127 for the two left motors and 128 to 255 for the right. Should we be using the RX pin for something?? I looked and found code to read the receiver.
Thank you in advance for any help. If you need any more explanation I will get back to this forum ASAP.
The code is too long to pot so it is attached in word and .ino
IT COMPILES GUYS!!
I feel like I’m almost there but I just need a little help.
- This topic was modified 2 months ago by Alexander Hicks. Reason: Code upload error
Attachments:You must be logged in to view attached files.March 27, 2017 at 9:32 am #4109
We don’t carry the PING)) sensors and have never used them, so we can’t really provide you any guidance on those.
Regarding the Sabertooth, do you have the motors spinning yet? We always use packetized serial instead of simplified serial. Simplified serial is much more susceptible to noise — if the data transmission gets garbled then there are no safety nets in place to prevent bad commands from being applied to the motors. Packetized serial uses checksums to catch such errors which makes it a much safer operation mode. Also, the Sabertooth library that you’re using right now uses packetized serial mode. If you want to do simplified serial mode (not recommended) you need to use the SabertoothSimplified library instead. Otherwise, change your dip switch settings to packetized mode.
The Sabertooth doesn’t transmit any serial data so you don’t need to use the Rx line on the Arduino. However, if you are using packetized mode then the Sabertooth’s S2 line functions as an Estop input. The Sabertooth will only move the motors when it sees 5V on S2; if it sees ground on S2 then it will immediately stop the motors. So connect S2 to one of your Arduino’s digitals and set it HIGH or LOW accordingly.
You must be logged in to reply to this topic.