All Projects → xreef → PCF8591_library

xreef / PCF8591_library

Licence: MIT, Unknown licenses found Licenses found MIT LICENSE Unknown LICENSE.md
Library to use i2c analog IC with arduino and esp8266. Can read analog value and write analog value with only 2 wire (perfect for ESP-01).

Programming Languages

C++
36643 projects - #6 most used programming language
c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to PCF8591 library

PCF8575 library
Library to use i2c digital expander with arduino, esp8266 and esp32. Can read write digital value with only 2 wire (perfect for ESP-01).
Stars: ✭ 28 (+16.67%)
Mutual labels:  i2c, expander, arduino-library
PCF8574 library
i2c digital expander for Arduino, esp32, SMT32 and ESP8266. Can read write digital values with only 2 wire. Very simple to use and encoder support.
Stars: ✭ 145 (+504.17%)
Mutual labels:  i2c, expander, esp-01
BME680
Arduino Library to access the Bosch BME680 - temperature, pressure, humidity and gas sensor
Stars: ✭ 30 (+25%)
Mutual labels:  i2c, arduino-library
esp-01-WiFi-Scanner-ESP-01-OLED-I2C-Display
Scanner WiFi avec écran OLED I2C (SSD1306) sur un ESP-01 (ESP8266)
Stars: ✭ 21 (-12.5%)
Mutual labels:  i2c, esp-01
SoftWire
Software I2C implementation for Arduino and other Wiring-type environments
Stars: ✭ 105 (+337.5%)
Mutual labels:  i2c, arduino-library
miniboot
🏗️ An I2C bootloader for Arduino.
Stars: ✭ 62 (+158.33%)
Mutual labels:  i2c, arduino-library
arduino-mcp23017
Complete support of MCP23017
Stars: ✭ 44 (+83.33%)
Mutual labels:  i2c, arduino-library
gfx demo
GFX Demo for Arduino and the ESP-IDF
Stars: ✭ 63 (+162.5%)
Mutual labels:  i2c, arduino-library
audiofile
Handling audio files in Python
Stars: ✭ 17 (-29.17%)
Mutual labels:  read, write
arduino-sht
Repository for Sensirion humidity and temperature sensor support on Arduino
Stars: ✭ 43 (+79.17%)
Mutual labels:  i2c, arduino-library
I2C EEPROM
Library for I2C EEPROM - 24LC256
Stars: ✭ 27 (+12.5%)
Mutual labels:  i2c, arduino-library
Wordpress Android
WordPress for Android
Stars: ✭ 2,601 (+10737.5%)
Mutual labels:  read, write
fs-utils
Generalized file and path utils for Node.js projects.
Stars: ✭ 33 (+37.5%)
Mutual labels:  read, write
python-yamlable
A thin wrapper of PyYaml to convert Python objects to YAML and back
Stars: ✭ 28 (+16.67%)
Mutual labels:  read, write
Nintendoextensionctrl
Arduino library for communicating with Nintendo extension controllers
Stars: ✭ 67 (+179.17%)
Mutual labels:  i2c, arduino-library
SerialTransfer
Arduino library to transfer dynamic, packetized data fast and reliably via Serial, I2C, or SPI
Stars: ✭ 273 (+1037.5%)
Mutual labels:  i2c, arduino-library
Poseidon
stealthy UM <-> KM communication system without creating any system threads, permanent hooks, driver objects, section objects or device objects.
Stars: ✭ 189 (+687.5%)
Mutual labels:  read, write
spark-hadoopoffice-ds
A Spark datasource for the HadoopOffice library
Stars: ✭ 36 (+50%)
Mutual labels:  read, write
MCP7940
Arduino Library to access the MCP7940M, MCP7940N and MCP7940x Real-Time chips
Stars: ✭ 29 (+20.83%)
Mutual labels:  i2c, arduino-library
Ssd1306
Driver for SSD1306, SSD1331, SSD1351, IL9163, ILI9341, ST7735, PCD8544, Nokia 5110 displays running on Arduino/ESP32/Linux (Rasperry) platforms
Stars: ✭ 303 (+1162.5%)
Mutual labels:  i2c, arduino-library
Support forum pcf8591 English
Forum supporto pcf8591 italiano

You can find updated version of documentation on my site​ PCF8591

Library to use i2c analog IC with arduino and esp8266. Can read analog value and write analog value with only 2 wire (perfect for ESP-01).

06/04/2022: v1.0.2 Fix package size

Tutorial:

To download. click the DOWNLOADS button in the top right corner, rename the uncompressed folder PCF8591. Check that the PCF8591 folder contains PCF8591\\.cpp and PCF8591.h. Place the DHT library folder your <arduinosketchfolder>/libraries/ folder. You may need to create the libraries subfolder if its your first library. Restart the IDE.

Reef complete PCF8591 Analog input and analog output to digital converter with i2c bus.

I try to simplify the use of this IC, with a minimal set of operation.

Constructor: you must pas the address of i2c (to check the adress use this guide I2cScanner)

	PCF8591(uint8_t address);

for esp8266 if you want specify SDA e SCL pin use this:

	PCF8591(uint8_t address, uint8_t sda, uint8_t scl);

then IC as you can see in the image have 4 analog input and 1 analog output:

PCF8591 schema

So to read all analog input in one trasmission you can do (the value is from 0 to 255):

	PCF8591::AnalogInput ai = pcf8591.analogReadAll();
	Serial.print(ai.ain0);
	Serial.print(" - ");
	Serial.print(ai.ain1);
	Serial.print(" - ");
	Serial.print(ai.ain2);
	Serial.print(" - ");
	Serial.println(ai.ain3);

if you want read a single analog input or channel:

	int ana = pcf8591.analogRead(AIN0); // read analog 0

This IC have multiple type of read and you can use Analog input or analog channel (when you use single read analog input and channel are the same:

Channel selection

For example to read the value of channel 0 in Two differential input you must do:

	int ana = pcf8591.analogRead(CHANNEL0, TWO_DIFFERENTIAL_INPUT); // read analog 0

If you want write an analog value you must do (the value is from 0 to 255):

	pcf8591.analogWrite(128);

Additional feature is to read a write voltage: For the calculation of voltage you must pass some parameter:

  • microcontrollerReferenceVoltage: get voltage from microcontroller voltage (only AVR no esp8266 for esp 3.3v fixed)
  • referenceVoltage: if microcontrollerReferenceVoltage false take this value

The command are:

	void voltageWrite(float value, bool microcontrollerReferenceVoltage = true, float referenceVoltage = 5.0);
	float voltageRead(uint8_t analogPin, bool microcontrollerReferenceVoltage = true, float referenceVoltage = 5.0);

An examples is:

	pcf8591.voltageWrite(2.7); // 2.7Volts output
	delay(3000);

	float ana0V = pcf8591.voltageRead(AIN0); // Read voltage from analog 0
	Serial.println(ana0V);

For the examples I use this wire schema on breadboard: Breadboard

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].