Tell me what you want, What you really, really want.

Moderator: Mmiscool

User avatar
By cwilt
#32443 Is there an estimate as when SPI and 1-wire interfaces will be added?
User avatar
By Mmiscool
#32482 No estimate yet.

Still working on getting i2c to be usable and documented. I don't think that the i2c has been tested yet.
User avatar
By cwilt
#32505
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.
User avatar
By Rotohammer
#33254 I added OneWire & DS18B20 support in just a few minutes using the library at
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:
Code: Select all#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:
Code: Select all  // 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":

Code: Select allif ( 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:

Code: Select alllet 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 :)