Skip to content

Commit

Permalink
Definitions fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
dberenguer committed Nov 3, 2015
1 parent a8932ca commit ae4b350
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions examples/co2meter/co2meter.ino
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@

#include "regtable.h"
#include "swap.h"
#include "HTU21D.h"
#include <SparkFunHTU21D.h>
#include "Wire.h"
#include <HardwareSerial.h>

#define CO2_ENABLE_PIN 15
#define CO2_ENABLE_PIN 7

uint16_t co2Level = 0; // Holds the actual CO2 value

Expand All @@ -61,7 +61,6 @@ HTU21D htu;
*/
void setup()
{
Serial.begin(9600);
int i;

pinMode(CO2_ENABLE_PIN, OUTPUT);
Expand Down Expand Up @@ -104,6 +103,9 @@ void setup()
*/
void loop()
{
// Open serial port
Serial.begin(9600);

// Enable CO2 sensor
digitalWrite(CO2_ENABLE_PIN, HIGH);

Expand All @@ -116,11 +118,14 @@ void loop()
co2Level = readCO2();
// Transmit CO2 sensor data
swap.getRegister(REGI_CO2SENSOR)->getData();


// disable CO2 sensor
digitalWrite(CO2_ENABLE_PIN, LOW);


// Close serial port
Serial.end();
delay(2);

// Sleep
swap.goToSleep();
}
Expand Down

0 comments on commit ae4b350

Please sign in to comment.