Seeking source code for ActivityBot with ping & sweep (570-28015) in Propeller
BenthePI
Posts: 8
Hello everyone,
I'm new to robotics and helping my 8 yo daughter, Kennedy, follow her passion for robots. She's at the age where she can open files and download them to the ActivityBot, however writing code is well above her skill set.
I have found links to the code in stamp, but need it for the PropellerC and ActivityBot. Sorry if the topic was covered and posted, but searched for about 1/2 hour before resorting to posting.
Thank you,
-Ben (Kennedy's Dad)
I'm new to robotics and helping my 8 yo daughter, Kennedy, follow her passion for robots. She's at the age where she can open files and download them to the ActivityBot, however writing code is well above her skill set.
I have found links to the code in stamp, but need it for the PropellerC and ActivityBot. Sorry if the topic was covered and posted, but searched for about 1/2 hour before resorting to posting.
Thank you,
-Ben (Kennedy's Dad)
Comments
Have you seen this page?
http://learn.parallax.com/activitybot
Hal
http://learn.parallax.com/activitybot
Activities specific to the Ping and ActivityBot are here:
http://learn.parallax.com/activitybot/navigate-ultrasound
Again, not sure about the sweep aspect, but that's not really necessary to experiment with the ActivityBot, Propeller C, and the Ping. In fact, for her age level, the extra code the BS2 sweep function entails could be confusing.
This is a working copy only at the moment, but here is some code produced by Andy Lindsay recently for a tech support customer:
If you have any issues with it please reply and be as specific with describing your errors as possible. All libraries referenced for this project are available with the Learn folder/SimpleIDE.
I concur with Gordon and Hal in that you should definitely spend the time to go through the Propeller C and ActivityBot tutorials, if you haven't already. 8 years old is a great age to start learning basic programming skills and concepts.
@ Courtney, after reading that actually looks like what I'm after. It looks like the servo is using Pin 16 and the ping to 17. I assume both are 5 volt on the VIn.
Is there any other information needed like do the resistors to P14 & P15 remain in place? It looks like they provide power to those terminals. I also assume it's the same process of write on switch selection 1, switch to Zero, pull mini USB, switch to 3 & press reset to start?
I will type it into SimpleIDE when Kennedy comes home from school.
Thanks everyone for the warm welcome and will post back when we have the project completed.
Cheers,
-Ben
Everything remains in place as set up originally for the ActivityBot, electronically, and the normal procedure for loading the program applies. Program on 1, switch to 0 (off), remove from USB cable, place on the ground, switch to 2 and let it roam.
If you notice the ramping speed is too slow/fast, you can play around with it by changing its value in this line (make the value greater or lower):
I have mine set to 25.
Time to sine! (For Kennedy at least).
I was able to load the code in. At first Kennedy typed it and messed up a line, so resorted to copy & paste.
Once switch 2 is on the robot looks to the right and backs up until it's picked up and that's the extent of the program.
Cheers,
-Ben
Line 23 changed 1800 to 180.
Line 43 changed 900 to 90, however the program had the same result.
Is there a resin the angle has an extra zero?
I haven't had a chance to try the code on my ActivityBot, but the angle for the servo function is in tenths of a degree. That way you can work with integers (smaller code) and still have 1/10 degree resolution for the servo. (So 1800 is the scaled version of 180.0 degrees, or 180.0 * 10 degrees).
.
Tom
23 to 1800
28 to 1800
43 to 900
Now the servo rotates to the left and it goes forward about a 2 Ft & ticks forward a cm every 2-3 seconds.
If not anything it's interesting to see how the change in code reacts when loaded.
Try changing the drive_rampstep to drive_ramp and add a short "pause(time)" after it. Otherwise try increasing the drive_setramp () value as Courtney suggested (try this first, before changing drive_rampstep.) I haven't used drive_rampstep in any of my programs, so I'm not quite sure how it works, but from the program I think it increases the speed per step and runs one step??
Tom
http://learn.parallax.com/activitybot/roaming-infrared-flashlights
Either increase the step size or make sure that the loop repeats quickly enough so there is smooth motion.
hope this helps
Tom
I copied and pasted this code but I keep getting build error. Any suggestions?
Thanks!
I just tried copying (cutting & pasting) the code from Courtney's post above into SimpleIDE. Then I tried building it by clicking on the hammer icon (I'm away from where I have my activitybot). It built without any errors.
Make sure that when you cut & paste that you select all of the code (scroll down) and nothing else.
Tom
I restarted my computer and ran it again, and now it works perfectly.