Das Open-Control-Projekt - Die Alternative zur C-Control-I


Das Forum zur C-Control-1
Welche C-Control-Varianten existieren?
Übersicht - Suchen - Neueste 50 Beiträge - Neuer Beitrag - Login - Registrieren
INFO - FAQ - CC2-Forum - CCPro-Forum 

 12bits ADconv MAX128 vervolg Kategorie: Programmierung Basic (von Hans - 1.10.2006 18:40)
Hans nutzt:  CC1-M-Unit V1.2/2.0
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

Bisherige Antworten:

Re: 12bits ADconv MAX128 vervolg (von H.J.W. - 1.10.2006 22:15)
    Re: 12bits ADconv MAX128 vervolg (von Hans - 2.10.2006 18:59)
        Re: 12bits ADconv MAX128 vervolg (von Stefan Süßmann - 4.10.2006 10:26)
            Re: 12bits ADconv MAX128 vervolg (von Hans - 4.10.2006 17:46)
                Re: 12bits ADconv MAX128 vervolg (von H.J.W. - 4.10.2006 18:14)
                    Re: 12bits ADconv MAX128 vervolg (von Hans - 4.10.2006 21:44)
        Re: 12bits ADconv MAX128 vervolg (von H.J.W. - 2.10.2006 19:14)
            Re: 12bits ADconv MAX128 vervolg (von Hans - 2.10.2006 22:12)
                Re: 12bits ADconv MAX128 vervolg (von H.J.W. - 2.10.2006 22:46)