PCF8574_library/examples/01_blinkOnPin0/01_blinkOnPin0.ino
per1234 9dc37f94a3 Move example sketches to appropriately named folders
This change causes the example sketches to be accessible via the Arduino IDE's File > Examples > PCF8574 library menu after the library is installed.
2018-05-31 17:05:08 -07:00

24 lines
363 B
C++

#include "Arduino.h"
#include "PCF8574.h"
// Set i2c address
PCF8574 pcf8574(0x39);
void setup()
{
Serial.begin(115200);
// Set pinMode to OUTPUT
pcf8574.pinMode(P0, OUTPUT);
pcf8574.pinMode(P1, INPUT);
pcf8574.begin();
}
void loop()
{
pcf8574.digitalWrite(P0, HIGH);
delay(1000);
pcf8574.digitalWrite(P0, LOW);
delay(1000);
}