'{$STAMP BS2} CS con 2 ' Chip Select Pin CLK con 3 ' Clock Pin DIO_n con 4 ' Data In/Out Pin config var nib ' Configuration bits AD0 var word ' Analog Data Channel 0 AD1 var word ' Analog Data Channel 1 i var word high CS high DIO_n for i = 0 to 200 gosub convert0: debug DEC AD0, cr next myloop: ' do nothing here, until reset goto myloop convert0: ' Convert channel 0 only config = %1011 low CS shiftout DIO_n,CLK,lsbfirst,[config\4] shiftin DIO_n,CLK,msbpost,[AD0\12] high CS return