Sample projects for ThingPulse ePulse Feather C6
To build and run these sample projects follow these steps:
- Install VS Code and install Platformio
- Checkout this repository and open it in VS Code
- Select the sample project by clicking on env section in the footer:
- Build and flash the sample by clicking on the right arrow in VS Code footer:
- Turn on serial monitor by clicking on the plug symbol:
This example shows how to use the MAX17048 fuel gauge chip.
- Preparation: connect a LiPo battery to the ePulse Feather C6. Make sure polarity of the battery is correct-
- Select
env:fuel-gauge-simple
to run this example. TheESP32-C6
connects to theMAX17048
chip and reads battery voltage, state of charge (SoC) and change rate
This example shows how to use the MAX17048 fuel gauge chip. In addition to the previous example this code sends the battery voltage and the SoC to the given HTTP server. We used a node-red instance with http node to receive the values
- Preparation: connect a LiPo battery to the ePulse Feather C6. Make sure polarity of the battery is correct-
- Select
env:fuel-gauge-wifi
to run this example. TheESP32-C6
connects to theMAX17048
chip and reads battery voltage, state of charge (SoC) and change rate - Adjust WiFi ssid and password in
main-fuel-gauge-wifi.cpp
- Adjust host and port in the same file
- Setup http server to receive GET requests
Here is an example flow of node red. It receives requests under /epulsec6, converts them and sends the message to influx:
Content of the convert message
node
let payload = {};
payload.vBat = Number(msg.req.query.voltage);
payload.soc = Number(msg.req.query.soc);
let values = payload;
let tags = {};
tags.name = "epulse feather c6";
msg.payload = [values, tags];
return msg;