I Need Help With Coding for CC3000 , DHT11 and Arduino

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
FundManager
 
Posts: 5
Joined: Tue Jan 20, 2015 3:30 pm

I Need Help With Coding for CC3000 , DHT11 and Arduino

Post by FundManager »

my_weather_station:37: error: expected constructor, destructor, or type conversion before '.' token
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();

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: I Need Help With Coding for CC3000 , DHT11 and Arduino

Post by adafruit_support_mike »

You need to put any statements that don't simply declare a variable inside a function.

Locked
Please be positive and constructive with your questions and comments.

Return to “General Project help”