Javelin uart
Hi All,
I love the Javelin, it packs a lot of punch and is great for prototyping quickly.....However it is far too expensive to build into products.
I have a Uart problem......
I want to write; "Time = 332" as a serial output.
I know I can use uart.sendstring for "Time ="
I also know I can use uart.sendbyte to send individual characters, but how do I take the value of integer "Time" and send it as a string to an LCD? i.e.
What is the Javelin equivelant of SEROUT (, , "Time = ", DEC[noparse][[/noparse]Time})
ANy Help appreciated.
Istha
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
The robot is going to lose. Not by much. But when the final score is tallied, flesh and blood will beat the damn monster.
Adam Smith
I love the Javelin, it packs a lot of punch and is great for prototyping quickly.....However it is far too expensive to build into products.
I have a Uart problem......
I want to write; "Time = 332" as a serial output.
I know I can use uart.sendstring for "Time ="
I also know I can use uart.sendbyte to send individual characters, but how do I take the value of integer "Time" and send it as a string to an LCD? i.e.
What is the Javelin equivelant of SEROUT (, , "Time = ", DEC[noparse][[/noparse]Time})
ANy Help appreciated.
Istha
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
The robot is going to lose. Not by much. But when the final score is tallied, flesh and blood will beat the damn monster.
Adam Smith
Comments
char buf[noparse][[/noparse]20]; //to hold string output
int time = 23;
Format.sprintf(buf,"time = %d",time);
generates "time = 23",0 in array buf
My adapted Uart class has a sendString method that takes a char array as parameter
so you can use afterwards
myUart.sendString(buf);
The·Format class is here:
http://tech.groups.yahoo.com/group/JavelinCode/files/Javelin%20Stamp%20IDE/lib/stamp/util/text/
My adapted Uart class:
http://tech.groups.yahoo.com/group/JavelinCode/files/Javelin%20Stamp%20IDE/lib/stamp/core/
regards peter
Can you point me to a good link that explains how to link these libaries?
I
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
The robot is going to lose. Not by much. But when the final score is tallied, flesh and blood will beat the damn monster.
Adam Smith
<Javelin Install Path>\lib\stamp\util\text
(create folders with the above exact names if neccessary)
Use
· ·import stamp.util.text.*;
to use the Format class in your java files.
Rename the original Uart.java to Uart.org
and copy the new Uart.java and UartTools.java to folder
<Javelin Install Path>\lib\stamp\core
Regards peter