#Macro Add(n1,n2,n3,n4,n5,n6,n7,n8,n9,n10,n11,n12,n13)
w1 = w1 + n1
w2 = w2 + n2
w3 = w3 + n3
w4 = w4 + n4
w5 = w5 + n5
w6 = w6 + n6
w7 = w7 + n7
w8 = w8 + n8
w9 = w9 + n9
w10 = w10 + n10
w11 = w11 + n11
w12 = w12 + n12
w13 = w13 + n13
#EndMacro
Do
ReadAdc10 C.1, w0
w1 = 0 : w2 = 0 : w3 = 0 : w4 = 0
w5 = 0 : w6 = 0 : w7 = 0 : w8 = 0
w9 = 0 : w10 = 0 : w11 = 0 : w12 = 0
w13 = 0
; 1 2 3 4 5 6 7 8 9 10 11 12 13
If bit9 = 1 Then Add( 2,502,443,792,766,373,411,534,701,857,282,500,000 ) End If
If bit8 = 1 Then Add( 1,251,221,896,383,186,705,767,350,928,641,300,000 ) End If
If bit7 = 1 Then Add( 0,625,610,948,191,593,352,883,675,464,320,630,000 ) End If
If bit6 = 1 Then Add( 0,312,805,474,095,796,676,441,837,732,160,310,000 ) End If
If bit5 = 1 Then Add( 0,156,402,737,047,898,338,220,918,866,080,160,000 ) End If
If bit4 = 1 Then Add( 0,078,201,368,523,949,169,110,459,433,040,078,000 ) End If
If bit3 = 1 Then Add( 0,039,100,684,261,974,584,555,229,716,520,039,000 ) End If
If bit2 = 1 Then Add( 0,019,550,342,130,987,292,277,614,858,260,020,000 ) End If
If bit1 = 1 Then Add( 0,009,775,171,065,493,646,138,807,429,130,009,800 ) End If
If bit0 = 1 Then Add( 0,004,887,585,532,746,823,069,403,714,565,004,900 ) End If
w12 = w13 / 1000 + w12
w11 = w12 / 1000 + w11
w10 = w11 / 1000 + w10
w9 = w10 / 1000 + w9
w8 = w9 / 1000 + w8
w7 = w8 / 1000 + w7
w6 = w7 / 1000 + w6
w5 = w6 / 1000 + w5
w4 = w5 / 1000 + w4
w3 = w4 / 1000 + w3
w2 = w3 / 1000 + w2
w1 = w2 / 1000 + w1
SerTxd( #w1, "." )
BinToAscii w2, b45,b44,b43,b42,b41 : SerTxd( b43,b42,b41, " " )
BinToAscii w3, b45,b44,b43,b42,b41 : SerTxd( b43,b42,b41, " " )
BinToAscii w4, b45,b44,b43,b42,b41 : SerTxd( b43,b42,b41, " " )
BinToAscii w5, b45,b44,b43,b42,b41 : SerTxd( b43,b42,b41, " " )
BinToAscii w6, b45,b44,b43,b42,b41 : SerTxd( b43,b42,b41, " " )
BinToAscii w7, b45,b44,b43,b42,b41 : SerTxd( b43,b42,b41, " " )
BinToAscii w8, b45,b44,b43,b42,b41 : SerTxd( b43,b42,b41, " " )
BinToAscii w9, b45,b44,b43,b42,b41 : SerTxd( b43,b42,b41, " " )
BinToAscii w10, b45,b44,b43,b42,b41 : SerTxd( b43,b42,b41, " " )
BinToAscii w11, b45,b44,b43,b42,b41 : SerTxd( b43,b42,b41, CR, LF )
Loop