'------------------------------------------------- ' Name : voice-dir.bas ' Compiler : PicBasic Pro - MicroEngineering Labs ' Notes : Voice Direct 364 to serial interface '------------------------------------------------- TRISB = %11111111 TRISA = %00000001 DEFINE OSC 4 include "modedefs.bas" Baud CON N2400 Com_In VAR PORTA.0 Com_Out VAR PORTA.1 delay var byte delay = 0 Serout com_out,Baud,[255,11] ' wake up serial servo controller Start: If PortB = 128 then Serout com_out,Baud,[255,1] If PortB = 64 then Serout com_out,Baud,[255,2] If PortB = 32 then Serout com_out,Baud,[255,3] If PortB = 16 then Serout com_out,Baud,[255,4] If PortB = 8 then Serout com_out,Baud,[255,5] If PortB = 4 then Serout com_out,Baud,[255,6] If PortB = 2 then Serout com_out,Baud,[255,7] If PortB = 1 then Serout com_out,Baud,[255,8] If PortB = 129 then Serout com_out,Baud,[255,9] If PortB = 65 then Serout com_out,Baud,[255,10] If PortB = 33 then Serout com_out,Baud,[255,11] If PortB = 17 then Serout com_out,Baud,[255,12] If PortB = 9 then delay = 20 If PortB = 5 then delay = 0 If PortB = 3 then Serout com_out,Baud,[255,15] pause delay goto start