Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- How can I get a byte that represents an unsigned int in Java?
- OutputStream out;
- public void writeToStream(int i) throws Exception {
- out.write(((byte)(i & 0xff)));
- }
- uint8_t nextByte() {
- while(1) {
- if(Serial.available() > 0) {
- uint8_t b = Serial.read();
- return b;
- }
- }
- }
- class writerThread(threading.Thread):
- def __init__(self, threadID, name):
- threading.Thread.__init__(self)
- self.threadID = threadID
- self.name = name
- def run(self):
- while True:
- input = raw_input("[W}Give Me Input!")
- if (input == "exit"):
- exit("Goodbye");
- print ("[W]You input %sn" % input.strip())
- fval = [ int(input.strip()) ]
- ser.write("".join([chr(x) for x in fval]))
Advertisement
Add Comment
Please, Sign In to add comment