Advertisement
Atdiy

Untitled

Mar 12th, 2012
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. CON
  2. _clkmode = xtal1 + pll16x
  3. _xinfreq = 5_000_000
  4.  
  5. XB_Rx = 0 'XBee DOut
  6. XB_Tx = 1 'XBee DIn
  7. XB_Baud = 9600 'XBee Baud Rate
  8.  
  9. PC_Rx = 31
  10. PC_Tx = 30
  11. PC_Baud = 9600
  12.  
  13. PB = 7
  14.  
  15. CR = 13
  16. VAR
  17. long State
  18. OBJ
  19. XB : "XBee_Object_2"
  20.  
  21. Pub Start
  22. XB.start(XB_Rx, XB_Tx, 0, XB_Baud)
  23. repeat
  24. if ina[PB] == 1
  25. NextState
  26. XB.Tx("!")
  27. XB.Dec(State)
  28. XB.CR
  29. XB.Delay(500)
  30.  
  31. Pub NextState
  32. State := State + 1
  33. If (State > 14)
  34. State := 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement