Trinket Rover

This is a special forum devoted to educators using Adafruit and Arduino products for teaching.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
scottw10
 
Posts: 12
Joined: Sun Dec 29, 2013 1:53 am

Re: Trinket Rover

Post by scottw10 »

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.

User avatar
adafruit_support_bill
 
Posts: 88087
Joined: Sat Feb 07, 2009 10:11 am

Re: Trinket Rover

Post by adafruit_support_bill »

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

scottw10
 
Posts: 12
Joined: Sun Dec 29, 2013 1:53 am

Re: Trinket Rover

Post by scottw10 »

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.

scottw10
 
Posts: 12
Joined: Sun Dec 29, 2013 1:53 am

Re: Trinket Rover

Post by scottw10 »

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.

scottw10
 
Posts: 12
Joined: Sun Dec 29, 2013 1:53 am

Re: Trinket Rover

Post by scottw10 »

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.

User avatar
pyrokld
 
Posts: 3
Joined: Wed Oct 14, 2015 4:04 pm

Re: Trinket Rover

Post by pyrokld »

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

User avatar
adafruit_support_bill
 
Posts: 88087
Joined: Sat Feb 07, 2009 10:11 am

Re: Trinket Rover

Post by adafruit_support_bill »

Thanks for posting your code.

Locked
Please be positive and constructive with your questions and comments.

Return to “For Educators”