Hello Atodos a happy 2013 to all can someone help me


Closed Thread
Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2008
    Posts
    81

    Default Hello Atodos a happy 2013 to all can someone help me

    Hello Atodos a happy 2013 to all
    I made a small program to drive a robot using the PicBasic program I made ​​in visual basic 6
    I'm with a difficulty of making the robot motors stop when I release the button on the keyboard.
    I need the pic reset all ports without using VISULA basic.Eu program could do more on own pic is connecting the engine and deligando

    The program's pic is here.
    A hug to everyone
    Include "modedefs.bas"
    TRISA=1 'PORT A input
    TRISB=%00001111 'PORT B output
    PORTB=0
    RX VAR BYTE

    PROG:
    SERIN PORTA.0,T9600,RX
    IF RX = "A" THEN FRT
    IF RX = "B" THEN TRA
    IF RX = "C" THEN DIR
    IF RX = "D" THEN ESQ
    GOTO PROG

    FRT:
    HIGH 4
    HIGH 6
    GOTO PROG

    TRA:
    HIGH 5
    HIGH 7
    GOTO PROG

    DIR:
    HIGH 5
    HIGH 6
    GOTO PROG

    ESQ:
    HIGH 4
    HIGH 7
    GOTO PROG

  2. #2
    Join Date
    Nov 2005
    Location
    Bombay, India
    Posts
    947


    Did you find this post helpful? Yes | No

    Default Re: Hello Atodos a happy 2013 to all can someone help me

    How about adding another case
    IF RX = "S" THEN StopAll

    StopAll:
    LOW 4
    LOW 5
    LOW 6
    LOW 7
    goto PROG

  3. #3
    Join Date
    Aug 2008
    Posts
    81


    Did you find this post helpful? Yes | No

    Default Re: Hello Atodos a happy 2013 to all can someone help me

    hello Jerson
    in this case the letter s has to come from vb6
    has another way to do this pic
    thanks for the reply

  4. #4
    Join Date
    Nov 2005
    Location
    Bombay, India
    Posts
    947


    Did you find this post helpful? Yes | No

    Default Re: Hello Atodos a happy 2013 to all can someone help me

    Unfortunately, there is no way you can know when the key has stopped. So, you have 2 alternatives

    1 - Let each command run for a small fraction of time before going back to prog
    example
    Code:
    FRT:
         HIGH 4
         HIGH 6
         pause 100
         LOW 4
         LOW 6
    GOTO PROG
    2 - Put a timeout. So, if Serin does not give you a character, turn off all outputs
    SERIN PORTA.0,T9600, 1000, Timeout, RX

    Timeout:
    Code:
       LOW 4
       LOW 5
       LOW 6
       LOW 7
    goto PROG
    This is from the manual
    An optional Timeoutand Labelmay be included to allow the program
    to continue if a character is not received within acertain amount of time.
    Timeoutis specified in 1 millisecond units. If the serial input pin stays in
    the idle state during the Timeouttime, the program will exit the SERIN
    command and jump to Label

  5. #5
    Join Date
    Aug 2008
    Posts
    81


    Did you find this post helpful? Yes | No

    Default Re: Hello Atodos a happy 2013 to all can someone help me

    Hello Jerson
    Thanks for the reply
    I made the example 2 it more of a lock works very well.
    look at the video
    thank you

  6. #6
    Join Date
    Nov 2005
    Location
    Bombay, India
    Posts
    947


    Did you find this post helpful? Yes | No

    Default Re: Hello Atodos a happy 2013 to all can someone help me

    Nice video.

Similar Threads

  1. Happy New Year........
    By lester in forum Off Topic
    Replies: 9
    Last Post: - 1st January 2013, 04:17
  2. Happy New Year!
    By tacbanon in forum Off Topic
    Replies: 0
    Last Post: - 1st January 2013, 02:47
  3. Happy new year!
    By tacbanon in forum Off Topic
    Replies: 0
    Last Post: - 31st December 2012, 17:10

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts