Shop OBEX P1 Docs P2 Docs Learn Events
hi all, i need help in bs2 :) — Parallax Forums

hi all, i need help in bs2 :)

smokysmoky Posts: 19
edited 2009-06-19 14:44 in BASIC Stamp
hi,· Dear all experts.·u can address me as smoky, im very interested in basic stamp2 and i would like to learn more. Currently im really lost. Please help me.

Recently i just bought bs2 and a ltc1298 cn8·convertor and a sharp gp2d12 light sensor.

Now the problem is with the connection of them.
i want to connect them together in·a way such·that when·the light sensor senses its object, the convertor will convert·the raw vaule·in 8bits (0-255).
( different distance will give a different 8bits ).

And also·after i have the 8bits, how can i write a program whereby the light sensor senses it object at centain distance, the bs2 will know when to turrn. Example (%11111111) turn left.

Please pm me or reply me·asap,·thanks
I·will really appreciated all the help.

Thanks to all the experts.

·

Comments

  • SRLMSRLM Posts: 5,045
    edited 2009-06-19 07:23
    A little work on your part would be helpful. I did a google search for "ltc1298" and the first page that came up was this. That page has pretty much everything that you need (code included). Since you only want 8 bits, you can ignore the lower 4 bits that you get back (from the 12 bit converter). I assume that the CN8 does not mean that it returns 8 bits (instead of 12), but is rather something to do with manufacturing.

    As for your second question on how to turn at a certain distance, take a look at the IF statement in the Basic Stamp Syntax and Reference Manual.
  • FranklinFranklin Posts: 4,747
    edited 2009-06-19 14:44
    Also if you are building a robot you can download the boebot manual from the resourses section of the parallax site. While you are there get 'What is a microcontroller"

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
Sign In or Register to comment.