Let's Make Robots!

DIRRS+

I have a problem. It says on the start here tutorial "make sure you buy analogue" but i went out and bought digital sensor-wise. My question is, how would one wire the DIRRS+ to my picaxe 28x board?

Thanks alot!

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
If the debug window doesn't change from "Waiting" it might be in your program, not how you hooked it up. Can you post the program?

START:

Serin 2,N4800,(%10101010),b0

Pause 2

debug

Goto START

why serin 2? From the picture you posted you connected it to port 1 
oh, it disconnected and i re soldered it

Ok now to the software:

remember: datasheets are your best friends, they tell you how to wire stuff, and how to code it, often by giving examples. So this is what it says about how it should be operated:

 In this mode the DIRRS+ uses TTL (5 Volt Logic) to serially transmit a preamble

byte (“10101010”) followed by a single byte. The mode is set to 4800 bps 8N1

Example code is given for the BASIC Stamp II. For other microcontrollers

please see our website for other examples or refer to your datasheet. An object

at 10 cm will result in Hex - FF (Binary 11111111 or DEC 255) being transmitted.

An object at 80 cm will result in Hex - 00 (Binary 00000000 or DEC 0) being sent.

When no object is present some fluctuations may occur in the measurement of

0V resulting in values being sent.

 

This may look complicated at first so they give us an example:

 

START:

Serin 0,N4800,(%10101010),b0

Pause 2

Goto START

 

Be advised that 0 (just after the serin command) is the output pin you are using, so it might be some other number. If it works correctly you will have your value stored in b0. You can then compare it to your standards (EG: if b0 < 150 then...)

I am not sure about how to write the qualifier  "(%10101010)" but i think the syntax is correct. If it doesn't work try removing the % (which stands for binary) or putting it inside "s.

Thanks so much i will test it right away!
It doesn't work :(
what exactly doesn't work?

The debug window just says waiting.

Are you sure you connected the right pins from the sensor to the right pins on the microcontroller board? You should also cehck the pins on the sensor to see which is pin1 and which pin4. (btw i am going to dinner see you later :) )