Shop OBEX P1 Docs P2 Docs Learn Events
Senor pack delivered! — Parallax Forums

Senor pack delivered!

Spiral_72Spiral_72 Posts: 791
edited 2010-03-08 19:31 in Accessories
I've been saving.... I burned $97 on the Parallax sensor pack (PING, compass, 2-axis accelerometer, and Ir motion detector) and an extra Ir motion detector. I received it Thursday!!! YEA!!! WOOHOO!

I loaded the PING sample code that displays in/cm on the console. I had to adjust the constants for an accurate reading but that's no big deal. I haven't played with the other sensors yet.

My first project was put the PING on a positioning servo and map the room out on my PC. I had to work around XP to get hardware access to the parallel port UGH! and finally got the port talking to the PING. I made my program in QBasic, but much to my disappointment, I think the language is too slow to pick up the pulse from the PING. I've verified the PING works, but my QBasic routine never sees the pulse. I suppose I'll have to get out my assembly compiler.... It's been a while for that!

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"puff"...... Smile, there went another one.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2010-03-01 16:07
    The maximum pulse width from the PING is about 18ms which should be detectable using QBasic. That's a long time for a PC, even with QBasic.
  • Spiral_72Spiral_72 Posts: 791
    edited 2010-03-01 17:50
    Hmmm, you think?

    It looks like the ping triggers off the negative slope of a 5V pulse..... Then I have 750us to be back waiting for the input which may be held high for 115us to 18.5ms...

    Ok, well then I get the stuff back out and go over it again.


    Mapping a room is for practice/learning/experimentation more than anything. My little Stamp can't hold all that data!

    Thank you....... It's really exciting to get a Parallax box in the mail!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "puff"...... Smile, there went another one.
  • logan996logan996 Posts: 281
    edited 2010-03-07 18:02
    Sorry to interupt but what is Qbaisc?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "When the government is afraid of the people there is liberty, when the people are afraid of the government, there is tryanny"

    · Thomas Jefferson
    ·
  • hover1hover1 Posts: 1,929
    edited 2010-03-07 18:25
    Wiki is your friend!

    http://en.wikipedia.org/wiki/QBasic

    Jim
    logan996 said...
    Sorry to interupt but what is Qbaisc?

  • Beau SchwabeBeau Schwabe Posts: 6,557
    edited 2010-03-07 18:29
    logan996,

    Qbasic is a BASIC programming language that's been around since 1987 for the PC still a very capable language.


    Spiral_72,

    I believe also that Qbasic is fast enough, but you may need to run it in a strict DOS mode.

    Years ago, before Parallax BS1, I wrote a program to control the position of RC servos through the parallel port using an 8088 processor. A pulse width ranging from 1ms to 2ms, a challenge in and of itself. By today's standards in terms of processing and computer speed, this should be a piece of cake. I'm willing to bet that Windows is the culprit and interfering with your timing.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • Spiral_72Spiral_72 Posts: 791
    edited 2010-03-08 19:31
    You are probably right. It's an XP machine, so while it's running my little Qbasic program, it's busy doing 29 other things.

    I KNEW I should have made this a dual boot system. I have on every computer till this point, and for some reason I only put XP on this one.

    I still couldn't get my program to work. I've been over and over it. I used integers instead of default (floating point), and trimmed every instruction I could out. I'll probably let it slide. The project was just for fun anyways. It's too bad though.


    It's amazing how accurate the PING is on the BS2! There's plenty of resolution!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "puff"...... Smile, there went another one.
Sign In or Register to comment.