ArduinoGeneral

DFRobot Temp Sensor code wont work.

userHead Account cancelled 2018-03-14 14:18:30 818 Views0 Replies
Ive made one Arduino project which has worked fine,but my latest using DFRobot temp sensor and 16x2LCD isnt working. The problem is when i verify the code on the IDE, I get error message saying variable or feild setup declared void. The code is by Bernie Chen and goes like this #include<DFRobotHighTemperatureSensor.h>
#include<LiquidCrystal.h>
const float voltageRef = 5.000; //Set reference voltage,you need test your IOREF voltage.
int HighTemperaturePin = AO; //Setting pin
DFRobotHighTemperature PT100 = DFRobotHighTemperature(voltageRef);
//Define an PT100 object

void setup (void {
Serial . begin(9600);
}

void loop (void) {
int temperature = PT100. readTemperature(HighTemperaturePin);
//Get temperature
more code.
Now Im such a novice with code so im gonna load it in exactly how it comes. Why does it repeat void setup void in the setup code and also the loop function.This is where im getting error messages . Thanks Jethro.