HELP WITH QTIs AND IRs ON BOE_BOT
Hello eveyryone,
I have programmed my boe-bot to follow a black tape and everything is fine with that!
I also want to avoid any object on the line of sight on the tape-path but, I am stuck on that..
I 've tried different ways to solve this problem but I can't put the code in the right order to work properly, or I just don't use the right commands...
Can anyone help me please?? Is there already a post for that??
Thanks in advance!
I have programmed my boe-bot to follow a black tape and everything is fine with that!
I also want to avoid any object on the line of sight on the tape-path but, I am stuck on that..
I 've tried different ways to solve this problem but I can't put the code in the right order to work properly, or I just don't use the right commands...
Can anyone help me please?? Is there already a post for that??
Thanks in advance!
Comments
Could you post the code you are trying to use as an attachment? Info on the sensor would be great.
Here is the code so far , on the right there are notes at Greek so don't mention them
For using the IR pairs I have tried in different ways the other code and the "Adapt RoamingWithWiskers.bs2 for use with IR pairs" (Robotics with the boe-bot page 250).31_FastIR.bs2
Well, for example, in the following case the left IR pair detects an object and it stops eveything.
I've put two blue leds at every side so to know exactly when one IR pair detects an object. When there is an object ,passes one sec and it stops moving.
Thanks for your time guys..
1) you have four bits of QTI sensor data, so that is 16 possible combinations (2^4). In your code, I count 10 cases and one else. You should probably have 16 cases, and no else so that your robot will always do something. As it is, your robot will stop (until you move it...) when it gets to one of those 6 cases.
2) In the case statement, you should move the common elements (GOSUB, PULSOUT) out of the case statements and inline with the case statements. It's better coding practice.
3) You have a DO-LOOP nested in a DO-LOOP, yet the inner loop is never exited making the outer loop a once only event.
4) In your Turn_R and Turn_L routines you need to add a pause statement for the servos, and you'll need some sort of pause for the main loop area where you have the CASE statement
Try these, and if you are still having issues be sure to post updated code and a detailed description of what is happening and what you expect (want) to happen.
So, I have placed the QTI code in a "If..then..elseif" routine (which can have exactly 16 "If-elseif" statements and another "If..then..elseif" for the IRs.
For better robot response I placed a third IR in the middle. Now, I have to solve what to do in the case that the robot finds an object ,turn accordingly the IR, but because it is ordered to do nothing in the case of QTIs = 0000 ,when it comes of the black tape it does nothing to go back the line after the object (but in a few attempts the solution will come I hope )
Additional, I put the 6 missing cases ,although some of them hypothetical will never appear in my task, like 0101.