Sub Main() '********YOU DO NOT NEED TO MODIFY ANY OF THESE LINES******* 'AS LONG AS YOU HAVE PINS 11 & 12 FOR SERIAL COMMUNICATION 'invar will contain information read from Serial cable (ie. from Director) dim invar as byte dim headerByteValue as byte 'set up a buffer using arrays dim InputBuffer(1 to 10) as byte dim OutputBuffer(1 to 10) as byte 'these are really 1 byte buffers with 9 byte overhead call openQueue(InputBuffer,10) call openQueue(OutputBuffer,10) 'set up the port call defineCom3(12,11,bx1000_1000) 'com3 is BX-24's second com port, (input pin, output pin, bandwidth) ' bandwidth: bx1000_1000 = 8 databits, no parity ' input pin (12) should have 22k resistor call openCom(3,9600,InputBuffer,OutputBuffer) '(com#,baud,in,out) debug.Print "starting program..." debug.Print " " '************END OF LINES THAT YOU DON'T NEED TO MODIFY*********** 'my two inputs: Switch & a variable resistor - CHANGE according to your inputs! dim sliderVar as integer dim switchVar as byte do '***THE CODE BELOW WILL VARY SLIGHTLY ACCORDING TO YOUR INPUTS** sliderVar = getADC(13) switchVar = getPin(14) ' convert integer to byte sliderVar = cInt( sliderVar\4 ) 'debug to see what numbers your inputs are giving debug.Print "sliderVar: ";cStr(sliderVar) debug.Print "switchvar: ";cstr(switchVar) 'send sensor variables to Director call putQueue(OutputBuffer,sliderVar,1) call putQueue(OutputBuffer,switchVar,1) 'BX will loop waiting to "hear back" from Director, with the number 255 'inVar = 0 'do while inVar <> 255 ' call getQueue(InputBuffer,invar,1) 'getQueue will wait until it hears something 'even if info not needed this is good for synch 'loop loop End Sub