Je m'explique :
Pour notre projet de TPE (moi et mes camarades


Si quelqu'un pouvez rapidement nous venir en aide ce serait vraiment sympa ^^
Merci d'avance

Posté 18 janvier 2012 - 04:29
Posté 14 février 2012 - 10:26
Posté 15 février 2012 - 02:34
main: readadc 0, b0 debug goto main Now take your hand in front of the robot´s head and notice how the variable b0 changes value. You can use the knowledge gained to decide what should happen and when (how close things should get before..) You may notice how things start to go "wrong" if stuff is too close to the "eyes"; The Sharp is made to work with objects 10-80 cm away. Things that are closer than 10 cm (4 inches) appear to be further way, which can be quite a challenge to program. You can get many other distance sensors that do not have this problem. However the Sharp is the cheapest, and easiest to program, so that's why I made such a "bad" choice for you, sorry <img src='http://www.robot-maker.com/forum/public/style_emoticons/<#EMO_DIR#>/wink.gif' class='bbc_emoticon' alt=';)' /> Look around and see what everyone else is using, before you decide on an upgrade. Now I advise you to put your robot up on a matchbox or similar, as the wheels will start turning. Enter this code into your editor, and press F5 while the robot is connected: high 4 low 5 One of the wheels should turn in one direction. Does your wheels turn forward? If so, this is the instruction for that wheel to turn forward. If the wheel is turning backwards, you can try this: low 4 high 5 To turn the other wheel, you need to enter high 6 low 7 (or the other way around for opposite direction.) What happens here is that by using only the options available to the microcontroller; power on or off (High / Low) on the pins, it is commanding the motor controller to set motor A or B in forward or reverse mode. low 4 low 5 low 6 low 7 stops all motors The servo you have already tried. All the way to one side is: servo 0, 75 wait 2 - the other side is: servo 0, 225 wait 2 - and centre: servo 0, 150 wait 2 Here is a small program that will (should, if all is well, and if you inserted the right parameters for high/low to suit your wiring to the motors) make the robot drive around, stop in front of things, look to each side to decide which is the best, turn that way, and drive towards new adventures. In the code I have made so called remarks: explaining you what is going on. You can write such comments or remarks yourself in the code, it is a good idea to keep track. They are written with an apostrophe (or single quote) sign. However, copying this text from here might alter that to something else, and you will have to fix that manually, sorry. Your programming editor has colour codes, that will help showing you what it recognizes as comments and what as code. Symbol dangerlevel = 70 ' how far away should thing be, before we react? symbol turn = 300 ' this sets how much should be turned symbol servo_turn = 700 ' This sets for how long time we should wait for the servo to turn (depending on it´s speed) before we measure distance main: ' the main loop readadc 0, b1 ' read how much distance ahead if b1 < dangerlevel then gosub nodanger ' if nothing ahead, drive forward else gosub whichway ' if obstacle ahead then decide which way is better end if goto main ' this ends the loop, the rest are only sub-routines nodanger:' this should be your combination to make the robot drive forward, these you most likely need to adjust to fit the way you have wired your robots motors high 5 : high 6 : low 4 : low 7 return whichway: gosub totalhalt ' first stop! 'Look one way: gosub lturn ' look to one side pause servo_turn ' wait for the servo to be finished turning readadc 0, b1 gosub totalhalt 'Look the other way: gosub rturn ' look to another side pause servo_turn ' wait for the servo to be finished turning readadc 0, b2 gosub totalhalt ' Decide which is the better way: if b1<b2 then gosub body_lturn else gosub body_rturn end if return body_lturn: high 6 : low 5 : low 7 : high 4 ' this should be your combination that turns the robot one way pause turn : gosub totalhalt return body_rturn: high 5 : low 6 : low 4 : high 7 ' this should be your combination that turns the robot the other way pause turn : gosub totalhalt return rturn: servo 0, 100 ' look to one side return lturn: servo 0, 200 ' look to the other side return totalhalt: low 4 : low 5 : low 6 : low 7 ' low on all 4 halts the robot! Servo 0,150 ' face forward wait 1 ' freeze all for one second return
Posté 15 février 2012 - 05:11
j'ai une autre question.. si les réflecteur optique cny70 se branche sur de l'analogique comment faudra il les souder pour qu'elle soit relier a la picaxe ?
Posté 15 février 2012 - 06:08
Posté 08 mai 2012 - 07:35
Si mon commentaire vous a plus laissez nous un avis !
Nouveau sur Robot Maker ?
Jetez un oeil aux blogs, aux tutoriels, aux ouvrages, au robotscope aux articles, à la boutique et aux différents services disponible !
En attendant qu'une bibliothèque de fichiers 3D soit mise en place n'hésitez pas à demander si vous avez besoin du fichier 3D d'un des produits de la boutique... On l'a peut être !
Si vous souhaitez un robot pilotable par internet n'hésitez pas à visiter www.vigibot.com et à lire le sous forum dédié à vigibot!
0 members, 1 guests, 0 anonymous users