Trinket Rover
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
-
- Posts: 12
- Joined: Sun Dec 29, 2013 1:53 am
Re: Trinket Rover
Could be the sensor, although it is the one shown in the rover instructions and I've tried two different units with the same result. This still would not explain why the blink program runs when the unit is plugged into the USB port. It is definitely not the bootloader flashing because it continues to run as long as plugged in. I'll try a new trinket as get back to you. Can you recommend a sensor you know to be appropriate for this application? Thanks for your time.
- adafruit_support_bill
- Posts: 88087
- Joined: Sat Feb 07, 2009 10:11 am
Re: Trinket Rover
I suppose it is possible for a program to be half-loaded. But the chances of it working at all are pretty slim. And the blink program is pretty tiny, so I'd expect that to be completely overwritten.
The Ping sensors are pretty popular, so I expect they must work OK. But looking at the code, I don't see any other reason for the behavior you describe. Unless perhaps there is some interference that is confusing the sensor or corrupting the signal. If you can post some photos of your build we can check it over for possible problem areas.
For ultrasonic sensors, I like the Maxbotix units. The timing is all handled by the sensor itself so they are immune to any timing issues in your code. You can read the output directly as either an analog signal or serially.
http://www.adafruit.com/index.php?main_ ... q=maxbotix
The Ping sensors are pretty popular, so I expect they must work OK. But looking at the code, I don't see any other reason for the behavior you describe. Unless perhaps there is some interference that is confusing the sensor or corrupting the signal. If you can post some photos of your build we can check it over for possible problem areas.
For ultrasonic sensors, I like the Maxbotix units. The timing is all handled by the sensor itself so they are immune to any timing issues in your code. You can read the output directly as either an analog signal or serially.
http://www.adafruit.com/index.php?main_ ... q=maxbotix
-
- Posts: 12
- Joined: Sun Dec 29, 2013 1:53 am
Re: Trinket Rover
I've replaced the trinket with a new one, and your suspicions are well-founded. As long as there is a wall/object within 100 cm of the sensors, the rover behaves properly. But when there is no object, the rover does it's jitterbug and acts confused. I've ordered some Maxbotics sensors and will try them. Maybe someone has a code fix to make the Ping work appropriately when there is nothing to bounce a signal off of. Thanks again.
-
- Posts: 12
- Joined: Sun Dec 29, 2013 1:53 am
Re: Trinket Rover
Still haven't figured out the jitter effect with the Ping but now understand it happens when there is no echo (nothing in front in range). But we have moved on to trying to get the four-pin HC-SR04 sensors to work with trinket to no avail. We tested the sensors with a sketch for arduino (http://www.instructables.com/id/Simple- ... 4-Example/), then plugged the tester into a trinket and changed the pin assignments and deleted references to serial. But to no avail. Perhaps we are using the wrong trinket pins? Missing a library? If you know of an example that uses the HC-SR04 with a trinket, we will be appreciative.
-
- Posts: 12
- Joined: Sun Dec 29, 2013 1:53 am
Re: Trinket Rover
Can you explain how to connect an HC-SR04 ultrasonic sensor to a trinket to make an LED light up when the sensor reads an obstacle within 8-10cm? thanks.
- pyrokld
- Posts: 3
- Joined: Wed Oct 14, 2015 4:04 pm
Re: Trinket Rover
I realize this is an old post but this was the only thing that was coming up when I was still trying to solve my jitter problem. I have managed to eliminate the jittering when using a Maxbotix Ultrasonic Rangefinder by merging in the code from the Trinket Ultrasonic Rangefinder project that takes a mode value from a set of readings with the Tricket Rover code and then dropping in several extra servo refresh lines.
My sketch is located at: https://github.com/pyrokld/Arduino/blob ... tRover.ino
My sketch is located at: https://github.com/pyrokld/Arduino/blob ... tRover.ino
- adafruit_support_bill
- Posts: 88087
- Joined: Sat Feb 07, 2009 10:11 am
Re: Trinket Rover
Thanks for posting your code.
Please be positive and constructive with your questions and comments.