26 lines
349 B
C
26 lines
349 B
C
#include <wiringPi.h>
|
|
#include <pcf8591.h>
|
|
#include <stdio.h>
|
|
|
|
#define Address 0x48
|
|
#define BASE 64
|
|
#define A0 BASE+0
|
|
#define A1 BASE+1
|
|
#define A2 BASE+2
|
|
#define A3 BASE+3
|
|
|
|
int main(void)
|
|
{
|
|
unsigned char value;
|
|
wiringPiSetup();
|
|
pcf8591Setup(BASE,Address);
|
|
|
|
while(1)
|
|
{
|
|
analogWrite(A0,value);
|
|
printf("AOUT: %d\n",value++);
|
|
delay(20);
|
|
}
|
|
|
|
}
|