Full Duplex Serial
Newzed
Posts: 2,503
I·am using FullDuplex so my Proto Board can commnicate with Hyper, and everything works fine.· Now i want to send a word -35000 - to Hyper but the FullDuplex method comm.rx will only handle a byte.· How do I modify FullDuplex so I can send a word terminated with Enter?
Thanks
Sid
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Yesterday is history, tomorrow is a mystery, and today is a gift.
That is why they call it the present.
Don't have VGA?
Newzed@aol.com
·
Thanks
Sid
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Yesterday is history, tomorrow is a mystery, and today is a gift.
That is why they call it the present.
Don't have VGA?
Newzed@aol.com
·
Comments
If possible use FullDuplexSerial.spin from the Propeller Tool v1.05.5, it has the dec method you are looking for.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Mike
Use something like this:
Debug.str(string("Your word goes here", 10, 13))
This is assuming you have defined FullDuplexSerial as Debug [noparse]:)[/noparse]
Gr,
Mightor
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
| To know recursion, you must first know recursion.
Does anyone have the answer I need?
Sid
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Yesterday is history, tomorrow is a mystery, and today is a gift.
That is why they call it the present.
Don't have VGA?
Newzed@aol.com
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Mike
value :=value + databyte[noparse][[/noparse]0] * 10_000
value := value + databyte * 1000
value := value + databyte * 100
value := value + databyte * 10
value := value + databyte
HTH,
Jonathan
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
/code
value := value + databyte[noparse][[/noparse]0] * 10_000
value := value + databyte * 1000
value := value + databyte * 100
value := value + databyte* 10
value := value + databyte
/code
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
Try this, it's what I used when I testing FullDuplexSerialPlus.spin :
CON
_clkmode = xtal1 + pll16x
_xinfreq = 5_000_000
_stack = 200
obj
comm: "FullDuplexSerialPlus"
var
byte str1[noparse][[/noparse]36]
byte str2[noparse][[/noparse]36]
long num1
long num2
long num3
pub main | index, index2
comm.start(16,17,0,57600)
comm.str(string("Gimme a number!",10,13))
num1 := comm.GetDec
comm.str(string("I'm going to double that",10,13))
num2 := num1 * 2
comm.dec(num2)
comm.str(string(10,13,"Our original number was: "))
comm.dec(num1)
comm.str(string(10,13))
comm.str(string(10,13,"Maybe you want it in HEX? ",10,13))
comm.hex(num1,8)
comm.str(string(10,13,"Or maybe in binary even?",10,13))
comm.bin(num1,12)
comm.str(string(10,13))
comm.str(string("Now give me one in HEX",10,13))
num2 := comm.gethex
comm.str(string(10,13,"OK That was:",10,13))
comm.hex(num2,8)
comm.str(string(10,13,"Can we make it decimal easily?",10,13))
comm.dec(num2)
comm.str(string(10,13))
comm.str(string("Now for binary, gimme another number",10,13))
num2 := comm.getbin
comm.str(string(10,13,"In decimal that's",10,13))
comm.dec(num2)
comm.str(string(10,13))
comm.str(string("Now just give me a word or two, up to 30 characters",10,13))
comm.getstr(@str2)
index := strsize(@str2)
comm.dec(index)
comm.str(string(10,13))
repeat index2 from index to 0
comm.tx(str2[noparse][[/noparse]index2])
comm.str(string(10,13,"Oops, I got it backwards!",10,13))
Post Edited (Tom Wyckoff) : 9/4/2007 12:10:01 AM GMT