Shop OBEX P1 Docs P2 Docs Learn Events
Reading Input Value - Page 4 — Parallax Forums

Reading Input Value

124»

Comments

  • ZootZoot Posts: 2,227
    edited 2012-01-30 12:21
    Dillon -- try the attached, but you need to make some setup changes.

    This test program will show the captured message (if it is not one of your 4 special messages) on eight LEDs hooked up to the RC pins. So if you can, hook up 8 leds anodes through resistors to each RC pin, and connect the led cathodes to ground.

    This program should be RUN clocked by the Key at 20mhz.

    If one of the 4 messages are received correctly, one of the 4 leds on RB should light up and stay lit till the next valid message comes through.

    If it's another message, then you should see all 8 leds on RC blink twice and then the 8 bits of the message will be displayed for 5 seconds. If all leds go dark for 5 seconds after the two blinks, that's a byte of %00000000, otherwise you should see at least one led lit.

    Now, if you get messages on the 8 test leds, but don't get correct lighting of the 4 regular status leds, try commenting out the following line (just remove the first ') and rerun it:
    ' change this:
    ''{$DEFINE MESSAGE_LSB_FIRST}
    
    'to this:
    '{$DEFINE MESSAGE_LSB_FIRST}
    
  • ZootZoot Posts: 2,227
    edited 2012-02-01 10:46
    Actually, I got great news! I got in early this morning and started making the changes you suggested. I hooked up 8 LEDs to the board, put 330k resistors on them and ran the program. We have a repeatable occurrence of the Lock, Unlock, Trunk and Panic. I repeated each function 10 times and got the same values on the 8 LEDs. Below are my observances:

    RUN the program.
    The four colored LEDs all light up and then each light up, one after another, for one pass, and then all 8 LEDs light up.
    For Lock, LEDs 1 & 2 (RC.0 & RC.1) lights up for 5 seconds
    For Unlock, LEDs 1 & 3 (RC.0 & RC.2) lights up 5 seconds
    For Trunk, LEDs 1 & 4 (RC.0 & RC.3) lights up for 5 seconds
    For Panic, LEDs 1 & 5 (RC.0 & RC.4) lights up for 5 seconds

    I copied over what should be your actual received messages and you should see the correct one-of-four RB leds light up for one of the 4 special messages; 8 test leds for any others.

    I also removed the conditional compilation stuff and the unused constants and variables.
  • ZootZoot Posts: 2,227
    edited 2012-02-07 14:15
    Here is a 16-bit version of the working firmware. Some of the key fobs transmit 16 bit messages, not 8 bit messages.
Sign In or Register to comment.