Hi there,
I'm new with Arduino and try to teach myself by reading a lot and watching Youtube, so please take care.
I've bought the 37 Sensor Kit V 2.0 by elegoo and now try to use the 18B20 temp-sensor on the MKR1000.
The following sketch works fine with the UNO, but no chance to compile and upload it to the MKR1000.
//www.elegoo.com
//2016.06.13
#include <DallasTemperature.h>
#include <OneWire.h>
#include <DallasTemperature.h>
// Data wire is plugged into port 2 on the Arduino
#define ONE_WIRE_BUS 2
// Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)
OneWire oneWire(ONE_WIRE_BUS);
// Pass our oneWire reference to Dallas Temperature.
DallasTemperature sensors(&oneWire);
void setup(void)
{
// start serial port
Serial.begin(9600);
Serial.println("Dallas Temperature IC Control Library Demo");
// Start up the library
sensors.begin();
}
void loop(void)
{
// call sensors.requestTemperatures() to issue a global temperature
// request to all devices on the bus
Serial.print("Requesting temperatures...");
sensors.requestTemperatures(); // Send the command to get temperatures
Serial.println("DONE");
Serial.print("Temperature for the device 1 (index 0) is: ");
Serial.println(sensors.getTempCByIndex(0));
}
Error:
Arduino: 1.8.4 (Mac OS X), Board: "Arduino/Genuino MKR1000"
In file included from /Users/Michael/Documents/Arduino/libraries/Ds18b20/DallasTemperature.h:28:0,
from /Volumes/elegoo/code/Lesson 3 DS18B20/code/DS18B20/DS18B20.ino:4:
/Users/Michael/Documents/Arduino/libraries/OneWire/OneWire.h:108:2: error: #error "Please define I/O register types here"
#error "Please define I/O register types here"
^
exit status 1
Fehler beim Kompilieren für das Board Arduino/Genuino MKR1000.
Dieser Bericht wäre detaillierter, wenn die Option
"Ausführliche Ausgabe während der Kompilierung"
in Datei -> Voreinstellungen aktiviert wäre.
Please help, Thanks!
Michael