SPI and 1-wire
Posted: Wed Oct 28, 2015 5:47 am
Is there an estimate as when SPI and 1-wire interfaces will be added?
-->
Open Community Forum for ESP8266, Come share Arduino and IoT (Internet of Things)
https://www.esp8266.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.
#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);
// Start up the 18b20 library
Serial.println("\n\r18bB20 Init");
sensors.begin();
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;
}
let tempa = 0
let tempb = 0
ti tempa 0
ti tempb 1
SERIALPRINTLN tempa
SERIALPRINTLN tempb