Button stops when i use Serin


Closed Thread
Results 1 to 3 of 3

Hybrid View

  1. #1
    Join Date
    May 2005
    Posts
    49

    Question Button stops when i use Serin

    loop:
    button porta.4 ,0,0,0,b1,1,show 'AND I CAN'T GET THE BUTTON PUSH
    serin portb.1,4,B0 'IF I USE THIS COMMAND THE PROGRAM STOPS HERE
    if b0=1 then goto ok
    goto loop

    It is a simple code.If other pic sent data "1" then other pic will show with led
    but when i use serin command program stops and wait data "1" and when program stops i cant get the button commands if i remove serin command the program works well but i need serin command coz i want to use remote.

    Any suggestion?
    Asking is not a shame but not learning is a SHAME!!!

  2. #2
    Join Date
    Dec 2003
    Location
    Wichita KS
    Posts
    511


    Did you find this post helpful? Yes | No

    Default

    but when i use serin command program stops and wait data "1" and when program stops i cant get the button commands if i remove serin command the program works well but i need serin command coz i want to use remote
    You are stuck on your SerIn statement... It is waiting for input...You need to use a timeout on your SerIn...I can't remember if SerIn has a timeout, but I do know that SerIn2 does... Or you can use a interupt on your Button, instead of a scanpin...Or you can use a interupt on your SerIn routine.

    Dwayne
    Ability to Fly:
    Hurling yourself towards the ground, and missing.

    Engineers that Contribute to flying:
    Both optimists and pessimists contribute to the society. The optimist invents the aeroplane, the pessimist the parachute

    Pilots that are Flying:
    Those who know their limitations, and respect the green side of the grass...

  3. #3
    Join Date
    Dec 2003
    Location
    Wichita KS
    Posts
    511


    Did you find this post helpful? Yes | No

    Default

    Serin does have a timeout.


    SERIN Pin,Mode,{Timeout,Label,}{[Qual...],}{Item...}

    Thus your Serin needs a timeout of about 100 milliseconds (or whatever you deep necessary, and a label for it to jump to, (In your case, the label is "Loop")

    Dwayne
    Ability to Fly:
    Hurling yourself towards the ground, and missing.

    Engineers that Contribute to flying:
    Both optimists and pessimists contribute to the society. The optimist invents the aeroplane, the pessimist the parachute

    Pilots that are Flying:
    Those who know their limitations, and respect the green side of the grass...

Similar Threads

  1. Sony SIRC IR Issue
    By Ryan7777 in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 8th August 2015, 08:10
  2. 3 HPWM channels
    By docwisdom in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 4th April 2006, 02:43
  3. Code check -- button not working
    By docwisdom in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 2nd March 2006, 22:43
  4. Button Push within 3 second Window
    By Tissy in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 22nd December 2005, 10:06
  5. Button subfunction 16F628
    By Jųan in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 19th August 2005, 16:44

Members who have read this thread : 0

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