pcf.h 835 Bytes
#ifndef __PCF_H_
#define __PCF_H_

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <Wire.h>

#include "PCF8574.h"
#include "PCF8591.h"

const unsigned int sda = 0;
const unsigned int scl = 2;
PCF8574 pcf8574(0x20, scl, sda);
/* PCF8591 pcf8591(0x49, scl, sda); */
PCF8591 pcf8591(0x49);

int led = 0;
int PINbutton1 = 1;
int PINbutton2 = 2;
int PINbutton3 = 3;
int leeren11 = 4;
int leeren1 = 5;
int leeren2 = 6;
int fuellen2 = 7;

struct button {
  int pin;
  int holding;
  int pressed;
  int released;
};

struct button* button1 = (struct button*) malloc(sizeof(struct button));
struct button* button2 = (struct button*) malloc(sizeof(struct button));
struct button* button3 = (struct button*) malloc(sizeof(struct button));

void updateButton(struct button *buttonX);
void setup_pcf ();
void loop_pcf ();

#endif