Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- OBJ
- pst : "FullDuplexSerial"
- MM2125 : "Memsic2125"
- XB : "FullDuplexSerial"
- CON
- _clkmode = xtal1 + pll16x
- _xinfreq = 5_000_000
- xIn = 0
- yIn = 1
- XB_Rx = 6 ' XBee DOUT
- XB_Tx = 7 ' XBee DIN
- XB_Baud = 9600
- CR = 13 ' Carriage Return value
- PUB Go | x,y
- XB.start(XB_Rx, XB_Tx, 0, XB_Baud) ' Initialize comms for XBee
- MM2125.start(xIn, yIn) ' Initialize Memsic 2125
- repeat
- x := MM2125.Mx ' Read X axis
- y := MM2125.My ' Read Y axis
- XB.dec(x / 100) ' Display X axis, divided by 100
- XB.tx(9) ' Tab
- XB.dec(y / 100) ' Display Y axis, divided by 100
- XB.tx(13) ' New line
- WaitCnt(ClkFreq / 2 + Cnt)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement