-
Thread
LCD 20x4 I2C Bascom
8 MHz Taktfrequenz ' Pins für den I2C-Bus festlegen (Standard-Softwareemulation) Config Sda = Portc.4 ' SDA an PortC.4 Config Scl = Portc.5 ' SCL an PortC.5 ' Optional: I2C-Bus-Geschwindigkeit anpassen falls nötig ' Config I2cdelay = 1 Const Pcf8574_write = &H40
'Eingänge auf high legen Config Sda = Portc.4 'Mega 8 Config Scl = Portc.5 'Mega 8 'Config Sda = Portb.0 'Mega2560 'Config Scl = Portb.1
-
Thread
ATMega 48, Pinchange Interrupt, ASM
************************************************* PCI0_handler: clr count loop: sbi PORTC, 5 ;Portbit setzen rcall wait cbi PORTC, 5 ;Portbit löschen rcall wait inc count cpi count, 5 breq exit rjmp loop ;Programmschleife neu beginnen exit