INIT: 'Set as default macro !DEFS (ME) !MACR .OBJECTS ' Use analog data for macro !USEA ON ' Set Queue size !QSIZ 6536 ' Set analog span !SPAN 0, 250 ' Set max time !TMAX 7581 ' Set number of samples !PNTS 30 ' Shift left at max !SHFT ON ' Title plot !TITL XBee Bot Interface ' Set display information !DISP D9 G2 A0 S0 B15 R !ECHO OFF !PLOT ON ENDMAC OBJECTS: !POBJ Clear !PPER 0,0 ' Set Back Color ******** !POBJ oBack=11 ' Analog Arrival Code ******* !POBJ oAnalog.C=!POBJ lstData(AINVAL0).add= Bot(AINVAL0) says: (AINVAL1)(;) !POBJ rx(AINVAL0)=1(;) !POBJ oTimer0=0.1(;) (;) ' Timer 0 code and interval ******** !POBJ oTimer0.C=!POBJ rx*=0(;) !POBJ oTimer0 = 0(;) !POBJ oTImer0= 0 ' btnInit -- OBUTTON ***** !POBJ oButton.btnInit=78.,92.,12.,5.,&Initialize Xbee,8 !POBJ btnInit.F=Arial,8,1,0 !POBJ btnInit.tip=Set XBee for low guard times to quicken configuring '-- Event Code !POBJ btnInit.C=!POBJ lstReturn.clear(;) !POBJ lstreturn.add=Initializing(;) !Echo off(;) !POBJ lstReturn.add=Waiting..(;) !wait 2(;) !POBJ lstReturn.add=Sending +++(;) !SRAW +++(;) !GRAB 3(;) !POBJ lstReturn.add=(grab)(;) !POBJ lstReturn.add=Waiting...(;) !wait 2(;) !POBJ lstReturn.add=Sending ATGT 3(;) !Send ATGT 3(;) !GRAB(;) !POBJ lstReturn.add=(grab)(;) !POBJ lstReturn.add=Exiting(;) !SEND ATCN(;) !GRAB(;) !POBJ lstReturn.add=(grab)(;) !POBJ lstReturn.add=Done(;) !BELL(;) ' lstReturn -- OLIST ***** !POBJ oList.lstReturn=74.,61.,20.,31.8,9, !POBJ lstReturn.F=Arial,9,0,0 ' txtReturn -- OTEXT ***** !POBJ oText.txtReturn=76.,75.,15.,4.5,?,15,0,9 !POBJ txtReturn.F=Arial,9,0,0 ' btnSet -- OBUTTON ***** !POBJ oButton.btnSet=87.,69.,7.,5.,&Set,8 !POBJ btnSet.F=Arial,8,1,0 !POBJ btnSet.tip=Sets current setting with value '-- Event Code !POBJ btnSet.C=!POBJ lstreturn.clear(;) !wait 0.1(;) !SRAW +++(;) !GRAB 1(;) !POBJ lstreturn.add=(grab)(;) !send AT[(drpAT),mid,1,2] (txtReturn)(;) !POBJ lstreturn.add=Sending AT[(drpAT),mid,1,2] (txtReturn)(;) !GRAB 1(;) !POBJ lstreturn.add=(grab)(;) !ifTH (grab),==,?,!POBJ lstreturn.add=Not Found(;) !SEND ATCN(;) !GRAB 1(;) !POBJ lstreturn.add=(grab)(;) !POBJ lstreturn.add=Reading...(;) !Bell(;) !wait 0.1(;) !SRAW +++(;) !GRAB 1(;) !POBJ lstreturn.add=(grab)(;) !send AT[(drpAT),mid,1,2](;) !POBJ lstreturn.add=Sending AT[(drpAT),mid,1,2](;) !GRAB 1(;) !POBJ lstreturn.add=(grab)(;) !POBJ txtReturn=(grab)(;) !ifTH (grab),==,?,!POBJ lstreturn.add=Not Found(;) !SEND ATCN(;) !GRAB 1(;) !POBJ lstreturn.add=(grab)(;) !POBJ lstreturn.add=Done(;) !Bell ' drpPort -- ODROP ***** !POBJ oDrop.drpPort=80.,98.,7.,4.3,9,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,1 !POBJ drpPort.F=Arial,9,0,0 '-- Event Code !POBJ drpPort.C=!POBJ chkConnect=0 ' lblPort -- OLABEL ***** !POBJ oLabel.lblPort=70.,97.,10.,3.,XBee Port:,,0,9,0 !POBJ lblPort.F=Arial,9,1,0 ' chkConnect -- OCHECK ***** !POBJ oCheck.chkConnect=89.,98.,15.,5.,&Connect,0,11,0,9 !POBJ chkConnect.F=Arial,9,1,0 '-- Event Code !POBJ chkConnect.C=!PORT (drpPort)(;) !CONN ((ME)) ' drpAT -- ODROP ***** !POBJ oDrop.drpAT=69.,81.,30.,4.3,9,MY Set/Read device address hex,DL Set/Read Destination Address hex,NI Set/Read device name 20 char,ID Set/Read PAN ID,CH Set/Read channel hex,DB Read last RSSI level,PL Set/Read current power level 0-4,ED Read Energy Levels,VR Read Firmware Version,HV Read current hardware version,EC Read CCA failures,EA Set/Read ACK failures,MY Set/Read device address hex,DL Set/Read Destination Address hex,DL Set/Read Destination Address hex,DB,BD !POBJ drpAT.F=Arial,9,0,0 ' btnRead -- OBUTTON ***** !POBJ oButton.btnRead=74.,69.,7.,5.,&Read,8 !POBJ btnRead.F=Arial,8,1,0 !POBJ btnRead.tip=Reads current setting '-- Event Code !POBJ btnRead.C=!POBJ lstreturn.clear(;) !wait 0.1(;) !SRAW +++(;) !GRAB 1(;) !POBJ lstreturn.add=(grab)(;) !send AT[(drpAT),mid,1,2](;) !POBJ lstreturn.add=Sending AT[(drpAT),mid,1,2](;) !GRAB 1(;) !POBJ lstreturn.add=(grab)(;) !POBJ txtReturn=(grab)(;) !ifTH (grab),==,?,!POBJ lstreturn.add=Not Found(;) !SEND ATCN(;) !GRAB 1(;) !POBJ lstreturn.add=(grab)(;) !POBJ lstreturn.add=Done(;) !Bell ' Obj13 -- OLABEL ***** !POBJ oLabel.Obj13=69.,85.,28.,4.,---- Configuration ----,,0,9,0 !POBJ Obj13.F=Arial,9,0,0 ' lstData1 -- OLIST ***** !POBJ oList.lstData1=1.,90.,27.,21.4,8, !POBJ lstData1.F=Arial,8,0,0 ' rx1 -- OIMGBUT ***** !POBJ oImgBut.rx1=29.,86.,4.,8.,comp\led_red_0.jpg,1,comp\led_red_1.jpg,0 '-- Event Code !POBJ rx1.C=~PWAV nralarm(;) ' rx2 -- OIMGBUT ***** !POBJ oImgBut.rx2=29.,66.,4.,8.,comp\led_red_0.jpg,1,comp\led_red_1.jpg,0 ' rx3 -- OIMGBUT ***** !POBJ oImgBut.rx3=29.,45.,4.,8.,comp\led_red_0.jpg,1,comp\led_red_1.jpg,0 ' lstData2 -- OLIST ***** !POBJ oList.lstData2=1.,69.,27.,21.4,8, !POBJ lstData2.F=Arial,8,0,0 ' lstData3 -- OLIST ***** !POBJ oList.lstData3=1.,48.,27.,21.4,8, !POBJ lstData3.F=Arial,8,0,0 ' butFWD1 -- OBUTTON ***** !POBJ oButton.butFWD1=41.,89.,6.,4.,FWD,8 !POBJ butFWD1.F=Arial,8,0,0 '-- Event Code !POBJ butFWD1.C=' turn off messgae window(;) !MOFF ON(;) ' guard time(;) !WAIT 0.1(;) ' command mode(;) !SRAW +++(;) 'gaurd time(;) !WAIT 0.1(;) ' send address to communicate, exit command mode(;) !SEND ATDL 1,CN(;) !WAIT 0.1(;) !SEND F(;) ' butStop1 -- OBUTTON ***** !POBJ oButton.butStop1=41.,84.,6.,4.,STOP,8 !POBJ butStop1.F=Arial,8,0,0 '-- Event Code !POBJ butStop1.C=!WAIT 0.1(;) !SRAW +++(;) !WAIT 0.1(;) !SEND ATDL 1,CN(;) !WAIT 0.1(;) !SEND S(;) ' butRev1 -- OBUTTON ***** !POBJ oButton.butRev1=41.,79.,6.,4.,BACK,8 !POBJ butRev1.F=Arial,8,0,0 '-- Event Code !POBJ butRev1.C=!WAIT 0.1(;) !SRAW +++(;) !WAIT 0.1(;) !SEND ATDL 1,CN(;) !WAIT 0.1(;) !SEND B(;) ' butRight1 -- OBUTTON ***** !POBJ oButton.butRight1=48.,84.,6.,4.,RT,8 !POBJ butRight1.F=Arial,8,0,0 '-- Event Code !POBJ butRight1.C=' turn off messgae window(;) !MOFF ON(;) ' guard time(;) !WAIT 0.1(;) ' command mode(;) !SRAW +++(;) 'gaurd time(;) !WAIT 0.1(;) ' send address to communicate, exit command mode(;) !SEND ATDL 1,CN(;) !WAIT 0.1(;) !SEND R(;) ' butleft1 -- OBUTTON ***** !POBJ oButton.butleft1=34.,84.,6.,4.,LT,8 !POBJ butleft1.F=Arial,8,0,0 '-- Event Code !POBJ butleft1.C=' turn off messgae window(;) !MOFF ON(;) ' guard time(;) !WAIT 0.1(;) ' command mode(;) !SRAW +++(;) 'gaurd time(;) !WAIT 0.1(;) ' send address to communicate, exit command mode(;) !SEND ATDL 1,CN(;) !WAIT 0.1(;) !SEND L(;) ' butClear1 -- OBUTTON ***** !POBJ oButton.butClear1=28.,75.,5.,4.,CLR,8 !POBJ butClear1.F=Arial,8,0,0 '-- Event Code !POBJ butClear1.C=!POBJ lstData1.Clear ' butFWD2 -- OBUTTON ***** !POBJ oButton.butFWD2=41.,69.,6.,4.,FWD,8 !POBJ butFWD2.F=Arial,8,0,0 '-- Event Code !POBJ butFWD2.C=' turn off messgae window(;) !MOFF ON(;) ' guard time(;) !WAIT 0.1(;) ' command mode(;) !SRAW +++(;) 'gaurd time(;) !WAIT 0.1(;) ' send address to communicate, exit command mode(;) !SEND ATDL 2,CN(;) !WAIT 0.1(;) !SEND F(;) ' butStop2 -- OBUTTON ***** !POBJ oButton.butStop2=41.,64.,6.,4.,STOP,8 !POBJ butStop2.F=Arial,8,0,0 '-- Event Code !POBJ butStop2.C=!WAIT 0.1(;) !SRAW +++(;) !WAIT 0.1(;) !SEND ATDL 2,CN(;) !WAIT 0.1(;) !SEND S(;) ' butRev2 -- OBUTTON ***** !POBJ oButton.butRev2=41.,59.,6.,4.,BACK,8 !POBJ butRev2.F=Arial,8,0,0 '-- Event Code !POBJ butRev2.C=!WAIT 0.1(;) !SRAW +++(;) !WAIT 0.1(;) !SEND ATDL 2,CN(;) !WAIT 0.1(;) !SEND B(;) ' butRight2 -- OBUTTON ***** !POBJ oButton.butRight2=48.,64.,6.,4.,RT,8 !POBJ butRight2.F=Arial,8,0,0 '-- Event Code !POBJ butRight2.C=' turn off messgae window(;) !MOFF ON(;) ' guard time(;) !WAIT 0.1(;) ' command mode(;) !SRAW +++(;) 'gaurd time(;) !WAIT 0.1(;) ' send address to communicate, exit command mode(;) !SEND ATDL 2,CN(;) !WAIT 0.1(;) !SEND R(;) ' butleft2 -- OBUTTON ***** !POBJ oButton.butleft2=34.,64.,6.,4.,LT,8 !POBJ butleft2.F=Arial,8,0,0 '-- Event Code !POBJ butleft2.C=' turn off messgae window(;) !MOFF ON(;) ' guard time(;) !WAIT 0.1(;) ' command mode(;) !SRAW +++(;) 'gaurd time(;) !WAIT 0.1(;) ' send address to communicate, exit command mode(;) !SEND ATDL 2,CN(;) !WAIT 0.1(;) !SEND L(;) ' butClear2 -- OBUTTON ***** !POBJ oButton.butClear2=28.,54.5,5.,4.,CLR,8 !POBJ butClear2.F=Arial,8,0,0 '-- Event Code !POBJ butClear2.C=!POBJ lstData2.Clear ' butFWD3 -- OBUTTON ***** !POBJ oButton.butFWD3=41.,47.,6.,4.,FWD,8 !POBJ butFWD3.F=Arial,8,0,0 '-- Event Code !POBJ butFWD3.C=' turn off messgae window(;) !MOFF ON(;) ' guard time(;) !WAIT 0.1(;) ' command mode(;) !SRAW +++(;) 'gaurd time(;) !WAIT 0.1(;) ' send address to communicate, exit command mode(;) !SEND ATDL 3,CN(;) !WAIT 0.1(;) !SEND F(;) ' butStop3 -- OBUTTON ***** !POBJ oButton.butStop3=41.,42.,6.,4.,STOP,8 !POBJ butStop3.F=Arial,8,0,0 '-- Event Code !POBJ butStop3.C=!WAIT 0.1(;) !SRAW +++(;) !WAIT 0.1(;) !SEND ATDL 3,CN(;) !WAIT 0.1(;) !SEND S(;) ' butRev3 -- OBUTTON ***** !POBJ oButton.butRev3=41.,37.,6.,4.,BACK,8 !POBJ butRev3.F=Arial,8,0,0 '-- Event Code !POBJ butRev3.C=!WAIT 0.1(;) !SRAW +++(;) !WAIT 0.1(;) !SEND ATDL 3,CN(;) !WAIT 0.1(;) !SEND B(;) ' butRight3 -- OBUTTON ***** !POBJ oButton.butRight3=48.,42.,6.,4.,RT,8 !POBJ butRight3.F=Arial,8,0,0 '-- Event Code !POBJ butRight3.C=' turn off messgae window(;) !MOFF ON(;) ' guard time(;) !WAIT 0.1(;) ' command mode(;) !SRAW +++(;) 'gaurd time(;) !WAIT 0.1(;) ' send address to communicate, exit command mode(;) !SEND ATDL 3,CN(;) !WAIT 0.1(;) !SEND R(;) ' butleft3 -- OBUTTON ***** !POBJ oButton.butleft3=34.,42.,6.,4.,LT,8 !POBJ butleft3.F=Arial,8,0,0 '-- Event Code !POBJ butleft3.C=' turn off messgae window(;) !MOFF ON(;) ' guard time(;) !WAIT 0.1(;) ' command mode(;) !SRAW +++(;) 'gaurd time(;) !WAIT 0.1(;) ' send address to communicate, exit command mode(;) !SEND ATDL 3,CN(;) !WAIT 0.1(;) !SEND L(;) ' butClear3 -- OBUTTON ***** !POBJ oButton.butClear3=28.,33.2,5.,4.,CLR,8 !POBJ butClear3.F=Arial,8,0,0 '-- Event Code !POBJ butClear3.C=!POBJ lstData3.Clear ' AllFwd -- OBUTTON ***** !POBJ oButton.AllFwd=27.,25.,10.,5.,ALL FWD,8 !POBJ AllFwd.F=Arial,8,0,0 '-- Event Code !POBJ AllFwd.C=' turn off messgae window(;) !MOFF ON(;) ' guard time(;) !WAIT 0.1(;) ' command mode(;) !SRAW +++(;) 'gaurd time(;) !WAIT 0.1(;) ' send address to communicate, exit command mode(;) !SEND ATDL FFFF,CN(;) !WAIT 0.1(;) !SEND F(;) ' AllStop -- OBUTTON ***** !POBJ oButton.AllStop=27.,19.,10.,5.,ALL STOP,8 !POBJ AllStop.F=Arial,8,0,0 '-- Event Code !POBJ AllStop.C=!WAIT 0.1(;) !SRAW +++(;) !WAIT 0.1(;) !SEND ATDL FFFF,CN(;) !WAIT 0.1(;) !SEND S(;) ' AllLeft -- OBUTTON ***** !POBJ oButton.AllLeft=16.,19.,10.,5.,ALL LEFT,8 !POBJ AllLeft.F=Arial,8,0,0 '-- Event Code !POBJ AllLeft.C=' turn off messgae window(;) !MOFF ON(;) ' guard time(;) !WAIT 0.1(;) ' command mode(;) !SRAW +++(;) 'gaurd time(;) !WAIT 0.1(;) ' send address to communicate, exit command mode(;) !SEND ATDL FFFF,CN(;) !WAIT 0.1(;) !SEND L(;) ' AllRight -- OBUTTON ***** !POBJ oButton.AllRight=38.,19.,10.,5.,ALL RIGHT,8 !POBJ AllRight.F=Arial,8,0,0 '-- Event Code !POBJ AllRight.C=' turn off messgae window(;) !MOFF ON(;) ' guard time(;) !WAIT 0.1(;) ' command mode(;) !SRAW +++(;) 'gaurd time(;) !WAIT 0.1(;) ' send address to communicate, exit command mode(;) !SEND ATDL FFFF,CN(;) !WAIT 0.1(;) !SEND R(;) ' AllBack -- OBUTTON ***** !POBJ oButton.AllBack=27.,13.,10.,5.,ALL BACK,8 !POBJ AllBack.F=Arial,8,0,0 '-- Event Code !POBJ AllBack.C=!WAIT 0.1(;) !SRAW +++(;) !WAIT 0.1(;) !SEND ATDL FFFF,CN(;) !WAIT 0.1(;) !SEND B(;) ' butAut2 -- OBUTTON ***** !POBJ oButton.butAut2=57.,64.,6.,4.,Auto,8 !POBJ butAut2.F=Arial,8,0,0 '-- Event Code !POBJ butAut2.C=!WAIT 0.1(;) !SRAW +++(;) !WAIT 0.1(;) !SEND ATDL 2,CN(;) !WAIT 0.1(;) !SEND A(;) ' butAut1 -- OBUTTON ***** !POBJ oButton.butAut1=57.,84.,6.,4.,Auto,8 !POBJ butAut1.F=Arial,8,0,0 '-- Event Code !POBJ butAut1.C=!WAIT 0.1(;) !SRAW +++(;) !WAIT 0.1(;) !SEND ATDL 1,CN(;) !WAIT 0.1(;) !SEND A(;) ' butAut3 -- OBUTTON ***** !POBJ oButton.butAut3=57.,42.,6.,4.,Auto,8 !POBJ butAut3.F=Arial,8,0,0 '-- Event Code !POBJ butAut3.C=!WAIT 0.1(;) !SRAW +++(;) !WAIT 0.1(;) !SEND ATDL 3,CN(;) !WAIT 0.1(;) !SEND A(;) ' butAutAll -- OBUTTON ***** !POBJ oButton.butAutAll=53.,19.,11.,5.,Auto,8 !POBJ butAutAll.F=Arial,8,0,0 '-- Event Code !POBJ butAutAll.C=!WAIT 0.1(;) !SRAW +++(;) !WAIT 0.1(;) !SEND ATDL FFFF,CN(;) !WAIT 0.1(;) !SEND A(;) ' lblbot1 -- OLABEL ***** !POBJ oLabel.lblbot1=34.,89.,6.,3.,#1,,0,9,0 !POBJ lblbot1.F=Arial,9,1,0 ' lblBot2 -- OLABEL ***** !POBJ oLabel.lblBot2=34.,68.,6.,3.,#2,,0,9,0 !POBJ lblBot2.F=Arial,9,1,0 ' lblbot3 -- OLABEL ***** !POBJ oLabel.lblbot3=34.,47.,6.,3.,#3,,0,9,0 !POBJ lblbot3.F=Arial,9,1,0 ENDMAC