Shop OBEX P1 Docs P2 Docs Learn Events
OK I need help now soon, hint hint Ken G. or anyone else! — Parallax Forums

OK I need help now soon, hint hint Ken G. or anyone else!

GWJaxGWJax Posts: 267
edited 2009-02-18 20:33 in Robotics
I'm having trouble in sending a 12 bit code to a robot via a BS2px24, this is a binary code that needs to be sent:
0110 1000 0010 [noparse][[/noparse]Hex $682]

The timing is as such:

MarkOne=1.84mS
SpaceOne=1.952mS
MarkZero=6.74mS
SpaceZero=1.953mS


Now I know the Stamp is fast enough to handle this but I just can't seam to get it to accept the code, I'm using the PULSOUT command to send it but should I be using something else or I may have the timing set wrong on my end, but when connected to the oscop and I only see the lowering "grounding' of the pin to send the signal and nothing else. Sorry I cannot say what the robot is, but any code that would help me out here would be greatly appreciated or just point me in the right direction and I'll take it from there. And yes I have read all the manuals that I downloaded with no luck on this project or I just missed something in them.

Like I said I may have the calculations wrong in converting the timing for the duration on the PULSOUT command but not sure. this is what I came up with for the BS2px24.

MarkOne=1.84mS = 2300
SpaceOne=1.952mS = 2400
MarkZero=6.74mS = 8425
SpaceZero=1.953mS = 2441.25

Once this robot MOD is complete I'll post it on the complete project forum.

Thanks in advance,

Jax

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
If a robot has a screw then it must be romoved and hacked into..

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-02-16 05:48
    Unfortunately, the Stamps are not particularly good at this sort of timing because you can't time both the positive and negative sides of the pulse to the kind of accuracy you appear to need. If your device can tolerate a apace time thats only approximate (like 2ms), you could do:
    ' Somewhere in your initialization
        LOW   myPin
    ' Send a 1
        PULSOUT myPin,2300
        PAUSE     2
    ' Send a 0
        PULSOUT myPin,8425
        PAUSE     2
    
  • GWJaxGWJax Posts: 267
    edited 2009-02-16 06:01
    Mike I think your thinking of the BS2 the px has a 0.81uS that it can transmit on it. But I'll try to see if that works. Thanks for you input.

    Jax

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    If a robot has a screw then it must be romoved and hacked into..
  • GWJaxGWJax Posts: 267
    edited 2009-02-16 17:04
    Mike G. it was a no go on this function, but at least I got 12 pulses now. I did more research and I just found the */ and the INT command I forgot about for fractions that might work for my PAUSE command. So I'll try that tonight after work. I'll keep you informed what I find out.

    Jax

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    If a robot has a screw then it must be romoved and hacked into..
  • GWJaxGWJax Posts: 267
    edited 2009-02-18 20:33
    For an update I had figured it out, Instead of using the PULSOUT command I was able to just use the HIGH, PAUSE, LOW commands to get what I needed. My program looks like a hack job but it works. Once I finish up the rest of the program I'll submit a complete project mod for this Robot which is the Elvis Alive from WowWee, plus I'll clean up the code before I post it and document it as well. Thanks Mike G. for your time with my problem.

    Jax

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    If a robot has a screw then it must be romoved and hacked into..
Sign In or Register to comment.