Skip to content

Instantly share code, notes, and snippets.

@sbehrens
Created July 28, 2012 04:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sbehrens/3191851 to your computer and use it in GitHub Desktop.
Save sbehrens/3191851 to your computer and use it in GitHub Desktop.
CON
_clkmode = xtal1 + pll16x
_xinfreq = 5_000_000
VAR
long foodude
long datatown
byte hello
long i
OBJ
pst : "Parallax Serial Terminal"
sircs_rx : "sircs_rx"
sircs_tx : "sircs_tx"
PUB main
'initalize_reader
'reader
initalize_writer
writer
PUB initalize_reader
pst.Start(115_200)
pst.Str(String("Starting..."))
pst.NewLine
foodude := sircs_rx.start(12)
sircs_rx.enable
PUB reader
repeat
pst.NewLine
if sircs_rx.bit_count <> 0
datatown := sircs_rx.rx
writeserial(datatown)
PUB initalize_writer
sircs_tx.start(13,40_000)
PUB writer
repeat
i := 0
if sircs_tx.busy == 0
repeat while i < 3000
sircs_tx.tx(i,12,3)
repeat until sircs_tx.busy == 0
i++
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment