class project boe-bot + bs2
Hi, our class is doing a project using boe-bots now that we got a b2s to work with instead of a bs2p we are actually on our way getting the thing going.
attached is our code so far. weve basically have been following the robotics with the boe-bot book and used the whisker code. ive been looking at different codes. i like the idea of having lights for when the whiskers are hit so i put that in there for thought. at the top is a basic rundown of what i want our project to do.
' Boe-Bot uses whiskers to detect objects, and when bumping into them tries to maneuver around them..
'Boe-bot will run while in a light area.
'Boe-bot when in a shaded area will
'stop moving
'activate a servo clockwise for a set amount of time.
'stop for ten seconds
'REVERSE the servo
'Then do a U-turn and continue on its course (start the main routine again..
also attached is a basic rundown of the obstical course we are going to build. we where basically inspired by the video our teacher showed us of a boe-bot that put out a fire. Also is a pic of our wiring so far which is pretty spaghetti atm
heres my questiong . i think the boe bot will navigate the course with the whisker code and i know how to call the turn/move commands. So all i need to figure out now is how to code in the photo resistor part. im new to this type of coding and i was wondering how do i add in the activation of the photo resistors as an interupt or do i do it as an other "else" in the main do code? the way i think of it and the way the robotics text describes it. the boebot pulses forward and checks to see if the whiskers are hit. all i want to do is have it look for the whiskers then do another check to see if the photo resistors see dark.
when it sees dark on both resistors it will activate a servo that we are going to plug into the 14 slot and run that for 10-15 seconds clockwise. wait a second then reverse it. this part should be fairly simple it should work just like the wheels. then it will do the left turn twice ect then start back on the origional code. The servo will be "jerry-rigged" to a spool and crane that we got from a fancy legolike toy kit. this will have a magnet on it and basically pick up paperclips or other magnetic material on the other end of the path.
so the overall goal of the project is to navigate to the material in a darkened area and pick it up with its magnetic crane then return with the stuff.
If anyone has an example of how to get a boe bot to do two things at once or how i could add the photo resistor activator ide greatly appreciate it.
thank you.
attached is our code so far. weve basically have been following the robotics with the boe-bot book and used the whisker code. ive been looking at different codes. i like the idea of having lights for when the whiskers are hit so i put that in there for thought. at the top is a basic rundown of what i want our project to do.
' Boe-Bot uses whiskers to detect objects, and when bumping into them tries to maneuver around them..
'Boe-bot will run while in a light area.
'Boe-bot when in a shaded area will
'stop moving
'activate a servo clockwise for a set amount of time.
'stop for ten seconds
'REVERSE the servo
'Then do a U-turn and continue on its course (start the main routine again..
also attached is a basic rundown of the obstical course we are going to build. we where basically inspired by the video our teacher showed us of a boe-bot that put out a fire. Also is a pic of our wiring so far which is pretty spaghetti atm
heres my questiong . i think the boe bot will navigate the course with the whisker code and i know how to call the turn/move commands. So all i need to figure out now is how to code in the photo resistor part. im new to this type of coding and i was wondering how do i add in the activation of the photo resistors as an interupt or do i do it as an other "else" in the main do code? the way i think of it and the way the robotics text describes it. the boebot pulses forward and checks to see if the whiskers are hit. all i want to do is have it look for the whiskers then do another check to see if the photo resistors see dark.
when it sees dark on both resistors it will activate a servo that we are going to plug into the 14 slot and run that for 10-15 seconds clockwise. wait a second then reverse it. this part should be fairly simple it should work just like the wheels. then it will do the left turn twice ect then start back on the origional code. The servo will be "jerry-rigged" to a spool and crane that we got from a fancy legolike toy kit. this will have a magnet on it and basically pick up paperclips or other magnetic material on the other end of the path.
so the overall goal of the project is to navigate to the material in a darkened area and pick it up with its magnetic crane then return with the stuff.
If anyone has an example of how to get a boe bot to do two things at once or how i could add the photo resistor activator ide greatly appreciate it.
thank you.
Comments
'ADded photo resistor section++++++++++++++++++++++++++++++++++++++
ELSEIF (IN6 = 0) AND (IN3 = 0) THEN ' Both photoresistors detects ''''PHOTO RESISTOR CODE
PULSOUT 14, 650 ' activates servo thats plugged into 14...
PAUSE 10000 'PAUSE FOR ten seconds.
PULSOUT 14, 900 'reverses the servo on 14
PAUSE 1000 'waits a sec
GOSUB Back_Up ' Back up & U-turn (left twice)
GOSUB Turn_Left
GOSUB Turn_Left
ELSEIF (IN6 = 0) THEN ' Left photoresistor detects
PULSOUT 4, 800
PAUSE 2000
ELSEIF (IN3 = 0) THEN ' Right photoresistor detects
PULSOUT 4, 800
PAUSE 2000
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
it seems to work , the whisker code works and shadows on the photo resistors cause beeps , im glad i could just add it into the main loop cause im a little hazy on coding in this language, Now i just need to add a working servo to the 14 plug and hopefully the project will work.
we have our crane attached now. Now i just need to code in the routine for dropping the magnet and then backing up and turning out of the shadow. hopefully this works out. Biggest problem now after testing the crane is the servo we found for it is only a 180 servo. we might have to order a continuous rotation one. hopefully parallax ships fast cause we need to try and get this done before finals week .
Hey mikeyjuno,
Great crane! If you really get in a bind, you can modify a standard servo into a continuous rotation servo pretty easily. See http://www.instructables.com/id/Modify-a-Futaba-S3001-servo-for-continuous-rotatio/ or http://www.ranchbots.com/club/papers/Modifying%20Hobby%20Servo%20Motors%20for%20Continuous%20Rotation.pdf for the some ideas.
Good luck, your project looks quite fun!
Very impressive project.