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 

 Re: 12 bits AD Wandler Kategorie: Programmierung Basic (von Hans - 22.02.2006 20:20)
 Als Antwort auf Re: 12 bits AD Wandler von Stefan Süßmann - 20.02.2006 8:35
Hans nutzt:  CC1-M-Unit V1.2/2.0
> > Oke thanks,
> > but i dont understand it already
> > I have made this, but it donÂ’t works of course ??
> > Can you look at this once more
> >
> >
> > DEFINE Var1     BYTE[1]
> > DEFINE Var2     BYTE[2]
> > DEFINE AD1      WORD[2]
> > DEFINE AD2      WORD[3]
> > DEFINE AD3      WORD[4]
> > DEFINE AD4      WORD[5]
>
> OK.
>
> >
> > DEFINE Max127adres       &h90 '???
>
> This is the i2c-device-adress. Most i2c-devices have pins A0,A1,A2 to set the adress by putting them to 5V or ground. The adress-setting is shown in the datasheet. You have a max127 and a datasheet?
>
>
> >
> >
> > #Start
> > GOSUB programma
> >  PRINT"#ON_LCD#";
> >  PRINT"#L101#";
> >  PRINT"AD1 = ";AD1;
> >  PRINT"#L110#";
> >  PRINT"AD2 = ";AD2;
>
> If you have 2x16 display this will run out. AD1= 4 characters+ "AD1_=_" = 6 characters
>
>
> >  PRINT"#L201#";
> >  PRINT"AD3 = ";AD3;
> >  PRINT"#L210#";
> >  PRINT"AD4 = ";AD4;
> >  PRINT"#OFF#";
> > GOTO Start
> >
> >
> > #Programma
> >  PRINT"#ON_IIC#";
> >  PRINT"#START#";
> >  PUT Max127adres  
> >  PUT &hee  '???
> >  PRINT"#STOP#";
>
>  > > >            IIC.init
> > > > >          IIC.stop
> > > > >          IIC.start
> > > > >          IIC.send max127adresse
>
>
> There is a "stop" missing.
>
>
> >
> >  PRINT"#START#";
> >  PRINT Max127adres
> >  GET Var1
> >  GET Var2
> >  Var2 = Var2 SHR 4
> >  PRINT"#STOP#";
> >  PRINT"#OFF#";
> >  AD1 = ((Var1*16) + Var2)
> > RETURN
> >
> >
>
>
> Try again :-)
>
> bye
>
> Stefan

 Antwort schreiben

Bisherige Antworten: