Its getting closer but still won’t compile, heres the current program I’m trying to run, followed by the errors. Thank you for the help!
include “blynk/blynk.h”
include “blynk/BlynkSimpleParticle.h”
include “SparkCorePolledTimer/SparkCorePolledTimer.h”
//#include “Adafruit_DHT/Adafruit_DHT.h”
//#define DHTPIN 2 // what pin we’re connected to
//#define DHTTYPE DHT22 // DHT 22 (AM2302)
//#define BLYNK_PRINT Serial
SparkCorePolledTimer updateTimer(5000); //Create a timer object and set it’s timeout in milliseconds
void OnTimer(void); //Prototype for timer callback method
//DHT dht(DHTPIN, DHTTYPE);
//float main, aux, acc;
int main, mainRaw, aux, auxRaw, acc, accRaw;
char auth[] = "token";
void setup() {
Serial.begin(9600);
updateTimer.SetCallback(OnTimer);
Serial.println("DHTxx test!");
//dht.begin();
delay(5000); // Allow board to settle
pinMode(A0, Input);
pinMode(A1, Input);
pinMode(A2, Input);
Blynk.begin(auth);
}
void loop() {
Blynk.run();
updateTimer.Update();
//h = dht.getHumidity();
//t = dht.getTempCelcius();
mainRaw = analogRead(A0);
auxRaw = analogRead(A1);
accRaw = analogRead(A2);
main = map(mainRaw, 0, 4096, 0, 18.65);
aux = map(auxRaw, 0, 4096, 0, 18.65);
acc = map(accRaw, 0, 4096, 0, 18.65);
// Check if any reads failed and exit early (to try again).
//if (isnan(h) || isnan(t) || isnan(f)) {
//Serial.println("Failed to read from DHT sensor!");
//return;
}
{
void OnTimer(void) { //Handler for the timer, will be called automatically
main = ((int) (main * 10) / 10.0);
aux = ((int) (aux * 10) / 10.0);
acc = ((int) (acc * 10) / 10.0)
Blynk.virtualWrite(21, main);
Blynk.virtualWrite(22, aux);
Blynk.virtualWrite(23, acc);
}
cruisecontroldev4.cpp:1:1: error: ‘include’ does not name a type
^
cruisecontroldev4.cpp: In function ‘void setup()’:
cruisecontroldev4.cpp:20:1: error: ‘updateTimer’ was not declared in this scope
^
cruisecontroldev4.cpp:24:13: error: ‘Input’ was not declared in this scope
Serial.begin(9600);
^
cruisecontroldev4.cpp:27:1: error: ‘Blynk’ was not declared in this scope
//dht.begin();
^
cruisecontroldev4.cpp: In function ‘void loop()’:
cruisecontroldev4.cpp:32:1: error: ‘Blynk’ was not declared in this scope
Blynk.begin(auth);
^
cruisecontroldev4.cpp:33:1: error: ‘updateTimer’ was not declared in this scope
}
^
cruisecontroldev4.cpp: At global scope:
cruisecontroldev4.cpp:48:1: error: expected unqualified-id before ‘{’ token
// Check if any reads failed and exit early (to try again).
^
make[1]: *** […/build/target/user/platform-6cruisecontroldev4.o] Error 1
make: *** [user] Error 2
Error: Could not compile. Please review your code.