my_weather_station:40: error: expected constructor, destructor, or type conversion before '.' token
my_weather_station:43: error: expected constructor, destructor, or type conversion before '=' token
my_weather_station:44: error: expected constructor, destructor, or type conversion before '=' token
These are the messages that I get when I try to do this. Any Ideas?
Code: Select all
// Include required libraries
#include <Adafruit_CC3000.h>
#include <SPI.h>
#include <CC3000_MDNS.h>
#include <aREST.h>
#include "DHT.h"
int temperature;
int humidity;
// Define CC3000 chip pins
#define ADAFRUIT_CC3000_IRQ 3
#define ADAFRUIT_CC3000_VBAT 5
#define ADAFRUIT_CC3000_CS 10
// WiFi network (change with your settings !)
#define WLAN_SSID "********"
#define WLAN_PASS "********"
#define WLAN_SECURITY WLAN_SEC_WPA2
// DHT11 sensor pins
#define DHTPIN 7
#define DHTTYPE DHT11
// Create CC3000 & DHT instances
Adafruit_CC3000 cc3000 = Adafruit_CC3000(ADAFRUIT_CC3000_CS,
ADAFRUIT_CC3000_IRQ, ADAFRUIT_CC3000_VBAT, SPI_CLOCK_DIV2);
// Create aREST instance
aREST rest = aREST();
// Server instance
Adafruit_CC3000_Server restServer(80);
DHT dht(DHTPIN, DHTTYPE);
dht.begin();
// Connect to WiFi network
cc3000.connectToAP(WLAN_SSID, WLAN_PASS, WLAN_SECURITY);
// Measure from DHT
temperature = (uint8_t)dht.readTemperature();
humidity = (uint8_t)dht.readHumidity();