INFO - FAQ - CC2-Forum - CCPro-Forum |
|
Hallo If I change the last line in: var1=250 var2=32 print (var1*var2)+loop;"|"; next print "E" 'E is einde VAR. voor Excel RETURN Then I get the right results 8000, 8001, 8002 etc. so that works all right but if I leave the progr as bellow then I don't get any results, only 0 , 0 , what's still going wrong? with the IIC Hans DEFINE Var1 BYTE[1] DEFINE Var2 BYTE[2] DEFINE I BYTE[3] DEFINE D BYTE[4] DEFINE loop BYTE[5] DEFINE Max128adres &h50 DEFINE LED PORT[4] PRINT"#ON_LCD#";"#INIT#";"#CLR#";"#OFF#"; 'Initialize the LCD voor gebruik de IIC bus' PUT 0 'Nodig omdat er een bug in de c-control I v2.0x system zit' BAUD R9600 Led=ON #Start TOG LED FOR I = 1 to 200 IF NOT RXD THEN GOTO Pass GET D IF D = 68 THEN GOSUB Zend 'D is van Excel(Excel is klaar om te ontvangen) #Pass NEXT GOTO Start #Zend Print "S";"|"; 'S is de Start puls voor Excel for loop = 0 to 7 PRINT"#ON_IIC#"; PRINT"#START#"; PUT Max128adres PUT &B10001000 or (loop shl 4)'Choose channel' PRINT"#STOP#"; PRINT"#START#"; PUT Max128adres+1 GET Var1 GET Var2 PRINT"#STOP#"; PRINT"#OFF#"; print(Var1*16) + (Var2 SHR 4);"|"; 'calculate and print received analog value' next print "E" 'E is einde VAR. voor Excel RETURN |
Antwort schreiben |