pcf.h
835 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#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