Shop OBEX P1 Docs P2 Docs Learn Events
Boe-Bot, need help for code. — Parallax Forums

Boe-Bot, need help for code.

MichelBMichelB Posts: 154
edited 2009-07-11 06:53 in Robotics
Hi all, in RoamingTowardTheLight.bs2 herewith attached it is written in Main Routine "For mismatched photoresistors, use Appendix F (done), uncomment (what?) and use next line (where?)"
I've found: timeLeft = (timeLeft */ 384 - 7)
Questions:
What line must I comment?
Where must I place "timeLeft = (timeLeft */ 384) - 7"?
Thank you in advance.
Best regards.

Comments

  • Jessica UelmenJessica Uelmen Posts: 490
    edited 2009-07-10 16:43
    Hi MichelB,

    For RoamingTowardTheLight.bs2 you will replace the third line in the DO...LOOP of the Main Routine with your values. Currently it reads:

    DO
       GOSUB Test_PhotoResistors
       ' For mismatched photoresistors, use Appendix F, uncomment and use next line.
       ' timeLeft = (timeLeft */ 351) + 7      [b]<- Replace this line with your equation[/b]
       GOSUB Average_And_Difference
       GOSUB Navigate
    LOOP
    
    



    You don't need to comment anything out of this code, but you will have to remove the comment from in front of the equation and replace the equation with your own values. Otherwise, the compiler will skip over that completely. So yours would read like so:

    DO
       GOSUB Test_PhotoResistors
       timeLeft = (timeLeft */ 384) - 7  
       GOSUB Average_And_Difference
       GOSUB Navigate
    LOOP
    
    



    I hope this helps, please let me know if you need any further clarification.

    Jessica

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jessica Uelmen
    Education Department
    Parallax, Inc.
  • MichelBMichelB Posts: 154
    edited 2009-07-11 06:53
    Thank you very much Jessica.
Sign In or Register to comment.