Announcement

Collapse
No announcement yet.

hserout not being cleared/repeats last send

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    Originally posted by DavidP View Post
    Which message is being sent out twice? It helps to locate the problem area.
    "sleft" when I swipe left and "sright" when i swipe right over the sensors.

    upon withdrawing my hand, hserout sends the previous command "sleft" or "sright"
    Last edited by alevis; 4 weeks ago.

    Comment


    • #17
      Obviously the code you posted is NOT the same you are running. The only place in the code where the character strings "HLEFT" and HRIGHT" are found is in here:

      updateLEDs:
      ' select case gesture
      ' case 1 ' hold left
      hserout["hleft",13] <<<<<<<<<<<<<<<<<<<<<<<<< will always be sent each time this routine is called
      gosub LED_holdLeft
      PAUSE 2000
      hserout[13]
      ' case 2 ' hold center
      ' hserout ["hcenter", 13]
      ' ledCount = ledCount + 1
      ' if (ledCount = 3) then
      ' gosub LED_holdCenter
      ' gesture = 0
      ' pause rtime
      ' elseif (ledCount = 6) then
      ' ledCount = 0
      ' gosub LED_off
      ' pause rtime
      ' endif
      ' case 3 ' hold right
      ' hserout ["hright", 13] <<<<<<<<<<<<<<<<<<< How is it possible for this to be sent? It is commented out.
      ' gosub LED_holdRight
      ' PAUSE 2000
      ' case 4 ' left
      ' hserout ["sleft", 13]
      ' gosub LED_swipeLeft
      ' pause rtime
      ' case 5 ' right
      ' hserout ["sright", 13]
      ' gosub LED_swipeRight
      ' pause rtime
      ' case 6 ' center press
      ' hserout ["press_center", 13]
      ' gosub LED_pressCenter
      ' gosub clearDistance
      ' pause rtime
      ' end select
      gesture = 0
      return

      Also if the case staement in the routine "updateLEDs" is commented out then every pass thru your main routine will call updateLEDs and send the string "hleft"
      Dave Purola,
      N8NTA
      EN82fn

      Comment


      • #18
        Originally posted by DavidP View Post
        Obviously the code you posted is NOT the same you are running. The only place in the code where the character strings "HLEFT" and HRIGHT" are found is in here:

        updateLEDs:
        ' select case gesture
        ' case 1 ' hold left
        hserout["hleft",13] <<<<<<<<<<<<<<<<<<<<<<<<< will always be sent each time this routine is called
        gosub LED_holdLeft
        PAUSE 2000
        hserout[13]
        ' case 2 ' hold center
        ' hserout ["hcenter", 13]
        ' ledCount = ledCount + 1
        ' if (ledCount = 3) then
        ' gosub LED_holdCenter
        ' gesture = 0
        ' pause rtime
        ' elseif (ledCount = 6) then
        ' ledCount = 0
        ' gosub LED_off
        ' pause rtime
        ' endif
        ' case 3 ' hold right
        ' hserout ["hright", 13] <<<<<<<<<<<<<<<<<<< How is it possible for this to be sent? It is commented out.
        ' gosub LED_holdRight
        ' PAUSE 2000
        ' case 4 ' left
        ' hserout ["sleft", 13]
        ' gosub LED_swipeLeft
        ' pause rtime
        ' case 5 ' right
        ' hserout ["sright", 13]
        ' gosub LED_swipeRight
        ' pause rtime
        ' case 6 ' center press
        ' hserout ["press_center", 13]
        ' gosub LED_pressCenter
        ' gosub clearDistance
        ' pause rtime
        ' end select
        gesture = 0
        return

        Also if the case staement in the routine "updateLEDs" is commented out then every pass thru your main routine will call updateLEDs and send the string "hleft"
        Sorry about that typo,
        I fixed so maybe my question is a little more clear now.

        Comment


        • #19
          Well I don't see the modified code......
          Dave Purola,
          N8NTA
          EN82fn

          Comment


          • #20
            So what am I to presume?
            Dave Purola,
            N8NTA
            EN82fn

            Comment


            • #21
              Originally posted by DavidP View Post
              Well I don't see the modified code......
              "sleft" when I swipe left and "sright" when i swipe right over the sensors.

              upon withdrawing my hand, hserout sends the previous command "sleft" or "sright"

              Comment


              • #22
                Well I don't see the modified code......
                So what am I to presume?
                Obviously the code you posted is NOT the same you are running. The only place in the code where the character strings "SLEFT" and SRIGHT" are found to be commented out.
                Dave Purola,
                N8NTA
                EN82fn

                Comment


                • #23
                  Originally posted by DavidP View Post
                  Well I don't see the modified code......
                  So what am I to presume?
                  Obviously the code you posted is NOT the same you are running. The only place in the code where the character strings "SLEFT" and SRIGHT" are found to be commented out.
                  Sorry I misunderstood your question.
                  I was in the process of debugging the code when someone asked for a snippet of it so I forgot to un-comment the lines I thought were problematic when included the a link to the
                  full code listing. My apologies.
                  I have edited the code and re-uploaded it onto pastebin

                  I hope this clarifies things;
                  https://pastebin.com/KSJBDX60

                  Again I apologize for my mistake.

                  Comment


                  • #24
                    I have no idea what the hardware connected to the processor is doing but I would look ate the returned data values from the 5 sensors. Maybe there is some false triggering going on.
                    Dave Purola,
                    N8NTA
                    EN82fn

                    Comment

                    Working...
                    X