Having Serin Serout problems


Results 1 to 9 of 9

Threaded View

  1. #6
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,161

    Default Re: Having Serin Serout problems

    This is confusing.

    Code:
    Initial:
    if ign=1 then
      goto initial
    else
    Initiall:
      if x=0 then
        serin ign, 2, 600, setmaster, ["~"], module
        goto setmaster
      else
        pause 50
    seroutrpt:
        if a<=5 then 'sends serout command 5 times
          serout OUT, 2,["~",module]
          a=a+1
          goto seroutrpt
        endif
        trisb.1=1 'makes out and input temporarly
        trisb.0=0 'makes ign and output temporarly
        ign=0 'sends ground pulse to previous slave for slave count
        pause 50
        ign=1 'idles pulse
        goto waitcnt
      endif
    endif

    You can do simple IF for first test:

    Code:
    Initial:
    if ign=1 then
      goto initial
    endif
    
    Initiall:
    if x=0 then
      serin ign, 2, 600, setmaster, ["~"], module
      goto setmaster
    else
      pause 50
    seroutrpt:
      if a<=5 then 'sends serout command 5 times
        serout OUT, 2,["~",module]
        a=a+1
        goto seroutrpt
      endif
      trisb.1=1 'makes out and input temporarly
      trisb.0=0 'makes ign and output temporarly
      ign=0 'sends ground pulse to previous slave for slave count
      pause 50
      ign=1 'idles pulse
      goto waitcnt
    endif

    There are other ways to make constant loops too (WHILE-WEND for example).

    It would definitely help if you posted all your code.

    (I'm still digesting the rest of the logic, bit confusing for me)

    Robert
    Last edited by Demon; - 5th April 2013 at 18:12.
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

Similar Threads

  1. Using SEROUT and SERIN
    By acinorth in forum Test Area
    Replies: 1
    Last Post: - 20th July 2011, 11:33
  2. Serin Serout Help
    By MangoKid in forum mel PIC BASIC Pro
    Replies: 15
    Last Post: - 13th December 2010, 20:00
  3. SERIN and SEROUT
    By CumQuaT in forum mel PIC BASIC
    Replies: 10
    Last Post: - 3rd September 2009, 00:17
  4. serin and serout
    By yeelooi in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 6th December 2007, 08:35
  5. help with SERIN & SEROUT
    By navaismo in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 17th September 2005, 01:49

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