Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
linux
mpptChg
pictures
readme.md

readme.md

makerPower™ Arduino Library

OLED Solar Monitor

This directory contains a simple Arduino library providing access the makerPower via I2C and a couple of simple example sketches. It includes support for the ESP8266 software I2C implementation requiring specification of pin numbers for SDA and SCL. The library can also be compiled on a Raspberry Pi (requires wiringPi).

Sample Sketches

  1. lib_ser_test - Reads several values from the board and outputs their values via the serial port.
  2. lib_ole_test - Displays the charge state, solar power, battery voltage and current draw on a 2x16 character OLED display. This sketch may be easily ported to a LCD-based 2x16 character display. My prototype uses a Sparkfun LCD driver board that is actually an Arduino.

OLED backside

Linux Example

The linux directory contains a simple example using the library on a Raspberry Pi. Put the source in the same directory as the library files and use the command line in the 'm' file to compile. It assumes wiringPi has been installed. I just chmod +x m and compile using ./m in the same directory as the source files.

Run the demo program ./test_i2c.

Note that the I2C interface on all Pi versions has a bug that causes it to fail when the I2C slave stretches the clock (the makerPower stretches the clock slightly). A work-around is to reduce the I2C clock rate to 50 kHz that can be done by adding the following line to the /boot/config.txt file.

dtparam=i2c_arm_baudrate=50000
You can’t perform that action at this time.