I've made an Arduino thermostat for my home brewery. The webpage:
http://playground.arduino.cc/ComponentLib/Thermistor4
has been very helpful. Now I am trying to apply the example code to a similar device made with an ESP8266 MOD. The code does not compile.
My problem is that the Arduino device uses 5v, but the ESP uses 3.3v. Also, I don't know how to adjust the OFFSET variable in current working code- the ESP thermistors consistently read 3 degrees F too low compared to a glass thermometer.
I added the following libraries to Thermistor4:
#include <WiFiClient.h>
#include <WiFiServer.h>
#include <ESP8266WiFi.h>
#include <WiFiUdp.h>
#include <ESP8266WiFiMulti.h>
#include <Arduino.h>
The following is the error output:
Thermistor4.cpp: In member function 'void Thermistor4::SetUp()':
Thermistor4.cpp:30: error: 'INPUT' was not declared in this scope
pinMode((14 + this->Pin), INPUT);
^
Thermistor4.cpp:30: error: 'pinMode' was not declared in this scope
pinMode((14 + this->Pin), INPUT);
^
Thermistor4.cpp:31: error: 'LOW' was not declared in this scope
digitalWrite((14 + this->Pin), LOW);
^
Thermistor4.cpp:31: error: 'digitalWrite' was not declared in this scope
digitalWrite((14 + this->Pin), LOW);
^
Thermistor4.cpp:33: error: 'analogRead' was not declared in this scope
analogRead(this->Pin);
^
Thermistor4.cpp: In member function 'void Thermistor4::ReadADC(unsigned int)':
Thermistor4.cpp:44: error: 'analogRead' was not declared in this scope
this->ADCReading = analogRead(this->Pin); //takes about 100uS to read an analog Arduino pin.
^
Thermistor4.cpp: In member function 'void Thermistor4::Thermistor4SerialPrint()':
Thermistor4.cpp:136: error: 'Serial' was not declared in this scope
Serial.println("Thermistor4 Values:");
^
Thermistor4.cpp:137: error: 'DEC' was not declared in this scope
Serial.print("Pin: "); Serial.println(this->Pin, DEC);
^
Multiple libraries were found for "WiFiClient.h"
Used: /home/johnz/.arduino15/packages/esp8266/hardware/esp8266/1.6.5-947-g39819f0/libraries/ESP8266WiFi
Not used: /home/johnz/sketchbook/arduino-1.6.5-r5/libraries/WiFi
Exception in thread "AWT-EventQueue-0" java.lang.Error: Error: could not match input
at org.fife.ui.rsyntaxtextarea.modes.CPlusPlusTokenMaker.zzScanError(CPlusPlusTokenMaker.java:2077)
at org.fife.ui.rsyntaxtextarea.modes.CPlusPlusTokenMaker.yylex(CPlusPlusTokenMaker.java:2311)
at org.fife.ui.rsyntaxtextarea.modes.CPlusPlusTokenMaker.getTokenList(CPlusPlusTokenMaker.java:1901)
at org.fife.ui.rsyntaxtextarea.RSyntaxDocument.getTokenListForLine(RSyntaxDocument.java:416)
at org.fife.ui.rsyntaxtextarea.SyntaxView.paint(SyntaxView.java:719)
at javax.swing.plaf.basic.BasicTextUI$RootView.paint(BasicTextUI.java:1434)
at javax.swing.plaf.basic.BasicTextUI.paintSafely(BasicTextUI.java:737)
at javax.swing.plaf.basic.BasicTextUI.paint(BasicTextUI.java:881)
at javax.swing.plaf.basic.BasicTextUI.update(BasicTextUI.java:860)
at org.fife.ui.rtextarea.RTextAreaBase.paintComponent(RTextAreaBase.java:719)
at org.fife.ui.rsyntaxtextarea.RSyntaxTextArea.paintComponent(RSyntaxTextArea.java:1993)
at javax.swing.JComponent.paint(JComponent.java:1056)
at javax.swing.JComponent.paintChildren(JComponent.java:889)
at javax.swing.JComponent.paint(JComponent.java:1065)
at javax.swing.JViewport.paint(JViewport.java:728)
at javax.swing.JComponent.paintChildren(JComponent.java:889)
at javax.swing.JComponent.paint(JComponent.java:1065)
at javax.swing.JComponent.paintToOffscreen(JComponent.java:5219)
at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(RepaintManager.java:1572)
at javax.swing.RepaintManager$PaintManager.paint(RepaintManager.java:1495)
at javax.swing.BufferStrategyPaintManager.paint(BufferStrategyPaintManager.java:306)
at javax.swing.RepaintManager.paint(RepaintManager.java:1265)
at javax.swing.JComponent._paintImmediately(JComponent.java:5167)
at javax.swing.JComponent.paintImmediately(JComponent.java:4978)
at javax.swing.RepaintManager$4.run(RepaintManager.java:824)
at javax.swing.RepaintManager$4.run(RepaintManager.java:807)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:807)
at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:782)
at javax.swing.RepaintManager.prePaintDirtyRegions(RepaintManager.java:731)
at javax.swing.RepaintManager.access$1300(RepaintManager.java:64)
at javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1720)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
'INPUT' was not declared in this scope
Help, please!