Advertisement
otakus

Untitled

Nov 10th, 2012
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. import sys, os, serial, threading
  2.  
  3. counter = 0
  4.  
  5. def monitor():
  6. ser = serial.Serial(COMPORT, BAUDRATE, timeout=0)
  7. while (1):
  8. line = ser.readline()
  9. if (line != ""):
  10. print line[:-1]
  11. ser.write("3983853673620123")
  12. ser.write(counter%10)
  13. ser.write('\n')
  14. counter+=1
  15. print "Stop Monitoring"
  16.  
  17. """ -------------------------------------------
  18. MAIN APPLICATION
  19. """
  20.  
  21. print "Start Serial Monitor"
  22. print
  23.  
  24. COMPORT = 11; #this is the serial port, normally it's what it's in the arduino +1 so com0 on arduino would be comport 1 here.
  25. BAUDRATE = 115200
  26.  
  27. monitor()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement