
|
INFO - FAQ - CC2-Forum - CCPro-Forum |
|
||
|
Hoi Stefan Thanks for answering I have the Data sheet of the MAX127 but I donÂ’t get it I made both the Â….. Max127 adres &h90 and put & hee up So it cant work at all And how do I get AD1 t/m AD8 I cant work it out So I ask you, do you have a sample of one that works Hans DEFINE Var1 BYTE[1] DEFINE Var2 BYTE[2] DEFINE AD1 WORD[2] DEFINE AD2 WORD[3] DEFINE AD3 WORD[4] DEFINE AD4 WORD[5] DEFINE Max127adres &h90 #Start GOSUB programma PRINT"#ON_LCD#"; PRINT"#L101#"; PRINT"1=";AD1; PRINT"#L109#"; PRINT"2=";AD2; PRINT"#L201#"; PRINT"3=";AD3; PRINT"#L209#"; PRINT"4=";AD4; PRINT"#OFF#"; GOTO Start #Programma PRINT"#ON_IIC#"; PRINT"#START#"; PUT Max127adres PUT &hee PRINT"#STOP#"; > > 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 |