Hallo,
ich möchte gerne dies hier zu kommunizieren bringen
Datenblatt 31FL3731.pdf
Leider was ich bis jetzt geschafft habe die Adresse auszulesen 74h
Meine Anfängliche Code:
CodeBox BascomAVR
Ich würde mich SEHR freuen, wenn jemand mir Erklären könnte wie ich die Kommunikation aufbauen muss. Leider bin ich kein Englisch Könner
Bedanke mich im voraus.
ich möchte gerne dies hier zu kommunizieren bringen
Datenblatt 31FL3731.pdf
Leider was ich bis jetzt geschafft habe die Adresse auszulesen 74h
Meine Anfängliche Code:
CodeBox BascomAVR
'################### Config LCD ##################### Config Lcd = 24 * 2 , Chipset = Ks077 Config Lcdpin = Pin , Db4 = Portc.0 , Db5 = Portc.1 , Db6 = Portc.2 , Db7 = Portc.3 , E = Portc.4 , Rs = Portc.5 Cls Initlcd Cursor Off 'off Blink cls Locate 1 , 2 : Lcd "HALLO" wait 3 Cls $lib "i2c_twi.lbx" ' we do not use software emulated I2C but the TWI Config Scl = Portd.0 ' we need to provide the SCL pin name Config Sda = Portd.1 ' we need to provide the SDA pin name Config Twi = 400000 TWCR = &B00000100 I2cinit Const ADDRESSE = &H74 '&B0111 0100 I2C Adresse des IS31FL3731 Const COMM_REG = &HFD '&B1110 1101 = &HFD - Befehlsregister Const REG_CONFIG = &H00 Const PICTUREMODE = &H00 Const AUTOPLAYMODE = &H08 Const AUDIOPLAYMODE = &H18 Const PICTURE_MODE = &H01 Const AUTOFRAMEMODE = &H04 Const AUDIOMODE = &H08 Const PICTUREFRAME = &H01 Const SHUTDOWN = &H0A Const AUDIOSYNC = &H06 Const BANK1 = &H0B '##########Variable############################################# Dim Hbyte As Byte , Lbyte as byte , I as byte Dim Ca As Byte , Cb As Byte Dim y as Byte , x as Byte Dim Spalte As Byte Dim Zeile As Byte , Vor as Byte , A as byte Dim REG_PWM As Byte Dim PWM As Byte dim Frem8 as Byte Dim Busaddress As Byte Dim Busaddress_read As Byte Dim Chipaddress As Byte Ca = &B1111_1111 Cb = &B1111_1111 Zeile = &B00000000 REG_PWM = 36 PWM = 255 Frem8 = &B00000111 '++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ x = 1 y = 1 For Busaddress = 0 To 254 Step 2 I2cstart I2cwbyte Busaddress If Err = 0 Then Locate 1 , 1 : Lcd "Slave at : " ; Busaddress ; "d, = " ; Hex(busaddress) ; "hex" Chipaddress = Busaddress \ 2 Locate 2 , 1 : Lcd " with chip address " ; Hex(chipaddress) ; "h“" End if I2cstop Next wait 2 I2cstart I2cwbyte ADDRESSE if Err =1 Then Locate 1 , 1 : Lcd "1" ; Err '<= Err = 1 End if I2cstop wait 2 Do I2cstart I2cwbyte ADDRESSE I2cwbyte COMM_REG '&B1110 1101 = &HFD - Befehlsregister I2cwbyte REG_CONFIG I2cwbyte Zeile 'LED Control Register I2cwbyte Ca incr Zeile I2cwbyte Zeile 'LED Control Register I2cwbyte Cb I2cwbyte &H12 I2cwbyte &B00000000 I2cwbyte &H13 I2cwbyte &B00000000 I2cwbyte REG_PWM For REG_PWM = 36 to 51 'PWM = PWM + 3 I2cwbyte PWM next REG_PWM I2cwbyte BANK1 I2cwbyte REG_CONFIG I2cwbyte &B00000000 I2cwbyte PICTUREMODE I2cwbyte &B00000111 I2cwbyte SHUTDOWN I2cwbyte &B00000001 I2cwbyte &H07 I2cstop waitms 500 Zeile = 0 Loop End
Ich würde mich SEHR freuen, wenn jemand mir Erklären könnte wie ich die Kommunikation aufbauen muss. Leider bin ich kein Englisch Könner
Bedanke mich im voraus.
Anhänge
Zuletzt bearbeitet: