Hi,
guckst du hier!
Code:
'===============================================================================
'***| Mikrocontroller Config |**************************************************
'===============================================================================
'Microcontroller
'================
'AVR-File, Quarz, Baudrate, Hardwarestack, Softwarestack, Framesize
$regfile = "m32def.dat"
$crystal = 16000000
$baud = 19200
$hwstack = 200
$swstack = 200
$framesize = 200
'I²C Pins
'===============
'I²C - Bus Pinbelegung (Hardware I²C - Bus)
Config Scl = Portc.0
Config Sda = Portc.1
I2cinit
I2cstart
I2cwbyte &HE2
I2cwbyte 0
I2cwbyte &HA0
I2cstop
I2cstart
I2cwbyte &HE2
I2cwbyte 0
I2cwbyte &HAA
I2cstop
I2cstart
I2cwbyte &HE2
I2cwbyte 0
I2cwbyte &HA5
I2cstop
I2cstart
I2cwbyte &HE2
I2cwbyte 0
I2cwbyte &HE4 'neue Addresse HEX:E4
I2cstop
End
Lesezeichen