SparkFun Forums 

Where electronics enthusiasts find answers.

All things pertaining to wireless and RF links
By prussiap
#171630
Hi All,
I just received my rf266 from sparkfun and i'm having some initial coding issues I guess. I'm trying to get an RFID reader ID12LA that I also bought from sparkfun working. I have previously gotten the reader to work with both a Raspberry Pi and more recently with an arduino but I guess i'm having some conceptual/coding problems.

At this point I want the ID12LA on one of the synapse chips just reading serial input and then sending it to portal/SNAPy and just printing out the value. Something pretty simple.

My conceptual understanding
1. Monitor UART1 on rfid chip
2. crossTAlk with uart1 and transparent
3. On portal/Snapy bridge crosstalk transparent with std-io. then on hook_STDIN print the results.

Guess i'm totally lost though.
Here is my code:
Receiver:
Code: Select all
      
# Blink an LED once a second

# "\x5E\x34\x89"
otherNodeAddr = "\x5E\x34\x89"
 
from synapse.switchboard import *
from synapse.platforms import *

# a pin with an LED attached, pyXY boards have an LED on pin 10
@setHook(HOOK_STARTUP)
def init():
    initUart(1,9600)
    crossConnect(DS_STDIO, DS_TRANSPARENT)
    ucastSerial(otherNodeAddr)
    
@setHook(HOOK_STDIN)
def printData(data):
    print "hello something"
    print data
    
Sender:
Code: Select all
      
# Blink an LED once a second

from synapse.platforms import *
from synapse.switchboard import *
#"\x5E\x30\xAD"
otherNodeAddr = "\x5E\x30\xAD"
blinkPin = 15   # a pin with an LED attached, pyXY boards have an LED on pin 10
@setHook(HOOK_STARTUP)
def init():
    setPinDir(blinkPin, True)
    initUart(1,9600)
    crossConnect(DS_UART1, DS_TRANSPARENT)
    ucastSerial(otherNodeAddr)

@setHook(HOOK_1S)
def blink():
       pulsePin(blinkPin, 500, True)
I'm pretty sure there are a number of things wrong here but any nudge would be a good one.