Shop OBEX P1 Docs P2 Docs Learn Events
program stops to working — Parallax Forums

program stops to working

ArchiverArchiver Posts: 46,084
edited 2002-03-18 13:16 in General Discussion
hi,

first of all, hello.
i m new to this list but i heard it is very newbie friendly here,
so i hope that my question will find some open ears.

i got my bs2 today and was interfacing it with a devantech ultrasonic
range finder, using more or less there example software.
i just modified it to write the value of the range via the
serial port to some software.
unfortunately, everytime i open the serial port for listening to the
stamp, the program stops, i know this because the silent ping of the ultra
sonic stops.
otherwise it is running fine and debug mode gives me the right ranges.
the problem with the serialport occuours under windows and linux.
anyone any idea ?


thx a lot in advance

erich

ps: here the code:

'{$STAMP BS2}

wDist var word

INIT con 0
ECHO con 1

convfac con 29 ' use centimeters

'

main

gosub sr_sonar_2
'debug dec wDist, cr
serout 16,9600,[noparse][[/noparse]dec wDist]
pause 200
goto main

sr_sonar_2:

pulsout INIT,5 ' 10us init pulse
output INIT ' dummy command (delay)
rctime ECHO,1,wDist ' measure echo time
wDist=wDist/convfac ' convert to inches
pause 10
return

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2002-03-18 13:16
    Hi,

    Be sure your serial port DTR line is low or disconnect it.
    A high DTR keeps the stamp in reset

    Regards peter


    Oorspronkelijk bericht
    Van: rat@t... [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=9YSQDQstfa3jvxHv_3maamfluuPnCcLdQDGb-TsmxVKcxr9Qg-w5o6T1vhPTLYA22SDcjqqDRw]rat@t...[/url
    Verzonden: maandag 18 maart 2002 01:22
    Aan: basicstamps@yahoogroups.com
    Onderwerp: [noparse][[/noparse]basicstamps] program stops to working

    hi,

    first of all, hello.
    i m new to this list but i heard it is very newbie friendly here,
    so i hope that my question will find some open ears.

    i got my bs2 today and was interfacing it with a devantech ultrasonic
    range finder, using more or less there example software.
    i just modified it to write the value of the range via the
    serial port to some software.
    unfortunately, everytime i open the serial port for listening to the
    stamp, the program stops, i know this because the silent ping of the ultra
    sonic stops.
    otherwise it is running fine and debug mode gives me the right ranges.
    the problem with the serialport occuours under windows and linux.
    anyone any idea ?


    thx a lot in advance

    erich

    ps: here the code:

    '{$STAMP BS2}

    wDist var word

    INIT con 0
    ECHO con 1

    convfac con 29 ' use centimeters

    '

    main

    gosub sr_sonar_2
    'debug dec wDist, cr
    serout 16,9600,[noparse][[/noparse]dec wDist]
    pause 200
    goto main

    sr_sonar_2:

    pulsout INIT,5 ' 10us init pulse
    output INIT ' dummy command (delay)
    rctime ECHO,1,wDist ' measure echo time
    wDist=wDist/convfac ' convert to inches
    pause 10
    return





    To UNSUBSCRIBE, just send mail to:
    basicstamps-unsubscribe@yahoogroups.com
    from the same email address that you subscribed. Text in the Subject and
    Body of the message will be ignored.


    Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
Sign In or Register to comment.