Main control unit sends adc-value to other remotecontrol unit via xbees.
Remote control reads value and then writes to lcd.
And the problem:
When I press button in remote control, I think it sends something.
In main unit rssi-led flash then. But I can't read value.
Debug counter don't go, it's in freeze.
In main code row 47 I marked the problem.
If I put that line in program, the main unit don't send anything, I think it waits data from remote control, show value in lcd don't change.
In main unit should put led on when I press button in remote control.
Here are test codes:
Main unit:
And remote control
Xbees setup is from:
http://www.rev-ed.co.uk/docs/axe210_xbee.pdf
Page 9
So how I can send and receive between two xbees and picaxes?
Picaxes what I use are 40x2 3v.
Remote control reads value and then writes to lcd.
And the problem:
When I press button in remote control, I think it sends something.
In main unit rssi-led flash then. But I can't read value.
Debug counter don't go, it's in freeze.
In main code row 47 I marked the problem.
If I put that line in program, the main unit don't send anything, I think it waits data from remote control, show value in lcd don't change.
In main unit should put led on when I press button in remote control.
Here are test codes:
Main unit:
Code:
; =================================================
; File....... Bag_Control_REV.1.0
; Purpose.... JMG_AirSuspension_CTRL_Main_Unit
; Author..... JMGarage www.PorVWoo.fi
; E-mail.....
; Started.... 07 02 2010
; Updated.... DD MMM YYYY
; ===============================================
; -----[ Program Description ]---------------------------------------------
; -----[ Revision History ]------------------------------------------------
; -----[ I/O Definitions ]-------------------------------------------------
let dirsB = %11111111
let dirsD = %11110111
let adcsetup = %0000000011101111
Symbol LFHSen=A.7 'left front wheel height sensor
Symbol XbeeOut=D.7' to Xbee
Symbol XbeeIn=D.3 'From Xbee
; -----[ Constants ]-------------------------------------------------------
; -----[ Variables ]-------------------------------------------------------
Symbol LFH=w0 'left front wheel height
; -----[ EEPROM Data ]--------------------------------------------------
; -----[ Initialization ]------------------------------------------------------
Init:
high XbeeOut
pause 100
Main:
readadc 7,LFH 'Reads left front wheel height sensor
debug
serout XbeeOut, T2400, ($55,$44,LFH)
'serin XbeeIn,t2400,($55,$44),b20 'HERE IS PROBLEM LINE!!
if b20=1 then high B.0 '[B]led should turn on when button is pressed in remote control[/B]
endif
goto main
; -----[ Interrupt Routines (if used) ]-------------------------------------
; Interrupt:
; RETURN
; -----[ Subroutines ]-------------------------------------------------------
; RETURN
Code:
; =================================================
; File....... Bag_Control_REV.1.0
; Purpose.... JMG_AirSuspension_CTRL_Remote_Panel
; Author..... JMGarage www.PorVWoo.fi
; E-mail.....
; Started.... 07 02 2010
; Updated.... DD MMM YYYY
; ===============================================
; -----[ Program Description ]---------------------------------------------
; -----[ Revision History ]------------------------------------------------
; -----[ I/O Definitions ]-------------------------------------------------
let dirsB = %00000001
let dirsD = %11110111
let adcsetup = 0
Symbol XbeeOut=D.3' to Xbee
Symbol XbeeIn=D.2 'From Xbee
Symbol LCD=D.4 'to LCD
symbol B_LRH_UP=b0
; -----[ Constants ]-------------------------------------------------------
; -----[ Variables ]-------------------------------------------------------
Symbol LFH=w0 'left front wheel height
; -----[ EEPROM Data ]--------------------------------------------------
; -----[ Initialization ]------------------------------------------------------
Init:
pause 5000 'lets start with a short delay shall we?
high LCD 'sets output high for serial display
pause 5 'just to make sure the output is high
serout LCD,t2400,("?G420") 'configure the display as 4x20
Pause 500
serout LCD,t2400,("?f") 'clear the lcd and home the cursor
pause 500 'and waits for the display to settle
'high backlight 'switch on lcd backlight
serout LCD,t2400,("?B80")
pause 500
Main:
serout LCD,t2400,("?y0?x00JMG AIR SUSP CTRL")'here's the header
serin XbeeOut,t2400,($55,$44),LFH
serout LCD,t2400,("?y2?x00LFH ",#LFH,"cm")'and here's the status
if pinb.7=1 then
b20=1
serout XbeeIn, T2400, ($55,$44,b20)
b20=0
endif
goto main
; -----[ Interrupt Routines (if used) ]-------------------------------------
; Interrupt:
; RETURN
; -----[ Subroutines ]-------------------------------------------------------
; RETURN
Xbees setup is from:
http://www.rev-ed.co.uk/docs/axe210_xbee.pdf
Page 9
So how I can send and receive between two xbees and picaxes?
Picaxes what I use are 40x2 3v.
Attachments
-
2 KB Views: 7
-
1.5 KB Views: 1
Last edited: