We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]
Rating:
Author: Andrey Krivoshein
Last Updated: 2020-12-11
Package Version: 1.0.0.0
Category: Communication
Downloaded: 162 times
Not followed.
License: GNU General Public License (GPL)
PCF8574 - Port expander library for the AVR MCU. Written on the MikroPascal for AVR. The standard software driver I2C is used for operation. Tested in tandem with the ATTiny45 microcontroller. Can be used in conjunction with any AVR.
Do you want to subscribe in order to receive notifications regarding "PCF8574 - Port expander" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "PCF8574 - Port expander" changes.
Do you want to report abuse regarding "PCF8574 - Port expander".
DOWNLOAD LINK | RELATED COMPILER | CONTAINS |
---|---|---|
1607677600_pcf8574___port_e_mikropascal_avr.ZIP [1.42KB] | mikroPascal PRO for AVR |
|
// Example of use:
// In the main unit, put code here
// ...
uses PCF8574 ;
// ...
var
// Software I2C connections (examle), see more details in the Soft I2C library help
Soft_I2C_Scl_Output : sbit at PORTB1_bit;
Soft_I2C_Sda_Output : sbit at PORTB0_bit;
Soft_I2C_Scl_Input : sbit at PINB1_bit;
Soft_I2C_Sda_Input : sbit at PINB0_bit;
Soft_I2C_Scl_Direction: sbit at DDB1_bit;
Soft_I2C_Sda_Direction: sbit at DDB0_bit;
begin
// ...
PCF8574_Init(0x38, True); // Set address without R/W bit, Inverted flag set is TRUE
// ...
while True do
begin
// ...
PCF8574_SwON(B1); // Setting pin P1 to low level (if set flag Inverted)
end;
end.