Moderator: Mmiscool
Still working on getting i2c to be usable and documented. I don't think that the i2c has been tested yet.
http://esp8266basic.com
A BASIC interpreter for your ESP
Working now on Autodrop3d. A 3d printer with automatic part ejection system. https://autodrop3d.com
Mmiscool wrote:No estimate yet.
Still working on getting i2c to be usable and documented. I don't think that the i2c has been tested yet.
When time permits I will test i2c.
http://download.milesburton.com/Arduino ... 72Beta.zip
I added it via the Arduino IDE: Sketch->Include Library->Add .ZIP Library
Just before the line: String BasicVersion = "ESP Basic 1.xx";
I added:
#include <OneWire.h>
#include <DallasTemperature.h>
//change the next line to match the pin you'd prefer to use, I use GPIO5
#define ONE_WIRE_BUS 5
// Setup a oneWire instance to communicate with any OneWire devices
// (not just Maxim/Dallas temperature ICs)
//Output lead:red (VCC), yellow(DATA) , black(GND) -55'C~125'C
OneWire oneWire(ONE_WIRE_BUS);
// Pass our oneWire reference to Dallas Temperature.
DallasTemperature sensors(&oneWire);
In startup() after the line: Serial.begin(9600);
i added:
// Start up the 18b20 library
Serial.println("\n\r18bB20 Init");
sensors.begin();
Lastly, after the entry for the ai command in ExicuteTheCurrentLine(), I added a new command "ti":
if ( Param0 == "ti")
{
valParam2 = GetMeThatVar(Param2).toInt();
// call sensors.requestTemperatures() to issue a global temperature
// request to all devices on the bus
sensors.requestTemperatures(); // Send the command to get temperatures
SetMeThatVar(Param1, String(sensors.getTempCByIndex(valParam2)));
return;
}
Then compile & load into your ESP device.
I have 2 DS18B20 devices hooked up together, so to read each one:
let tempa = 0
let tempb = 0
ti tempa 0
ti tempb 1
SERIALPRINTLN tempa
SERIALPRINTLN tempb
Todo: Add a setup command so that one or more ports can be setup for OneWire capability from a BASIC command instead of being compiled in.
Now I'll go make my home thermostat