User Manual
Table Of Contents
VMA344
V. 01 – 10/04/2019 5 ©Velleman nv
9. Software Example
#include "Wire.h"
#define PCF8591 (0x90 >> 1)
byte adcvalue0, adcvalue1, adcvalue2, adcvalue3;
void setup()
{
Wire.begin();
Serial.begin(9600);
}
void loop()
{
Wire.beginTransmission(PCF8591);
Wire.write(0x04);
Wire.endTransmission();
Wire.requestFrom(PCF8591, 5);
adcvalue0=Wire.read();
adcvalue0=Wire.read();
adcvalue1=Wire.read();
adcvalue2=Wire.read();
adcvalue3=Wire.read();
Serial.print(adcvalue0);
Serial.print(" ,");
Serial.print(adcvalue1);
Serial.print(" ,");
Serial.print(adcvalue2);
Serial.print(" ,");
Serial.print(adcvalue3);
Serial.println();
delay(1000);
}
Example 2 software :
// Henry's Bench
// PCF8591 Simple DAC
// Controlling voltage output with your Arduino
#include "Wire.h"
#define PCF8591 (0x90 >> 1)
int Ain = 0;
int RawValue0 = 0;
int DACout = 0;
float DACoutVolt = 0.0;
float Voltage = 0.0;
void setup()
{
Wire.begin();







