As of July 2018, Raspbian does not yet include the latest Python release, Python 3.7.0 This means we will have to build it ourselves, and here is how to do it.
- Install the required build-tools (some might already be installed on your system).
const mqtt = require("mqtt"); | |
const Tools = require("./Tools"); | |
const Vacuum = require("./miio/Vacuum"); | |
const COMMANDS = { | |
turn_on: "turn_on", | |
return_to_base: "return_to_base", | |
stop: "stop", | |
clean_spot: "clean_spot", |
const mqtt = require("mqtt"); | |
const Tools = require("./Tools"); | |
const Vacuum = require("./miio/Vacuum"); | |
const COMMANDS = { | |
turn_on: "turn_on", | |
return_to_base: "return_to_base", | |
stop: "stop", | |
clean_spot: "clean_spot", |
const mqtt = require("mqtt"); | |
const Tools = require("./Tools"); | |
const Vacuum = require("./miio/Vacuum"); | |
const COMMANDS = { | |
turn_on: "turn_on", | |
return_to_base: "return_to_base", | |
stop: "stop", | |
clean_spot: "clean_spot", |
// MAX17043 1-Cell Fuel Gauge | |
// APP for https://github.com/tomsuch/M5StackSAM | |
void appAccuMeter(){ | |
MyMenu.drawAppMenu(F("ACCU METER"),F(""),F("ESC"),F("")); | |
const int MAX17043ADDR=0x36; | |
const int MAX17043CMDADDR=0xFE; | |
const int MAX17043SOCADDR=0x04; | |
const int MAX17043VCELLADDR=0x02; | |
time_t tmp_tmr; | |
double soc, volt; |
// | |
// This is tested and works! | |
// | |
String input = "123,456"; | |
int firstVal, secondVal; | |
for (int i = 0; i < input.length(); i++) { | |
if (input.substring(i, i+1) == ",") { | |
firstVal = input.substring(0, i).toInt(); | |
secondVal = input.substring(i+1).toInt(); |
#if defined ( ESP8266 ) | |
#include <queue.h> | |
#elif defined ( ESP32 ) | |
#include <sys/queue.h> | |
#endif | |
struct tailq_entry { | |
uint32_t value; | |
char mytext[2]; | |
bool stat; |