Hi all,
I am trying to port a library from Arduino to spark. I am expecting some problems, but now i have one that I didn’t expect at all. The library is the Cozir library for a CO2 sensor which is communication through the serial port (serial1 at spark)
below is some code from my ‘cozir.cpp’ file. I get several errors:
Cozir.cpp:58:5: error: ‘uint32_t’ does not name a type --> uint32_t CO2;
What am I doing wrong?
// FILE: Cozir.h
// AUTHOR: DirtGambit & Rob Tillaart
// VERSION: 0.1.05
// PURPOSE: library for COZIR range of sensors for Arduino
// Polling Mode
// URL: http://forum.arduino.cc/index.php?topic=91467.0
//
// READ DATASHEET BEFORE USE OF THIS LIB !
//
// Released to the public domain
//
// SPARK PORT by Prein
#ifndef Cozir_h
#define Cozir_h
#define COZIR_LIB_VERSION "0.1.05"
// OUTPUTFIELDS
// See datasheet for details.
// These defines can be OR-ed for the SetOutputFields command
#define CZR_LIGHT 0x2000
#define CZR_HUMIDITY 0x1000
#define CZR_FILTLED 0x0800
#define CZR_RAWLED 0x0400
#define CZR_MAXLED 0x0200
#define CZR_ZEROPOINT 0x0100
#define CZR_RAWTEMP 0x0080
#define CZR_FILTTEMP 0x0040
#define CZR_FILTLEDSIGNAL 0x0020
#define CZR_RAWLEDSIGNAL 0x0010
#define CZR_SENSTEMP 0x0008
#define CZR_FILTCO2 0x0004
#define CZR_RAWCO2 0x0002
#define CZR_NONE 0x0001
// easy default setting for streaming
#define CZR_HTC (CZR_HUMIDITY | CZR_RAWTEMP | CZR_RAWCO2)
// not in datasheet for debug only
#define CZR_ALL 0x3FFE
// OPERATING MODES
#define CZR_COMMAND 0x00
#define CZR_STREAMING 0x01
#define CZR_POLLING 0x02
class COZIR
{
public:
COZIR();
float Celsius();
float Fahrenheit();
float Humidity();
float Light();
uint32_t CO2;
uint16_t FineTuneZeroPoint(uint16_t , uint16_t);
uint16_t CalibrateFreshAir();
uint16_t CalibrateNitrogen();
uint16_t CalibrateKnownGas(uint16_t );
uint16_t CalibrateManual(uint16_t );
uint16_t SetSpanCalibrate(uint16_t );
uint16_t GetSpanCalibrate();
void SetDigiFilter(uint8_t );
uint8_t GetDigiFilter();
void SetOutputFields(uint16_t );
void GetRecentFields();
void SetEEPROM(uint8_t , uint8_t );
uint8_t GetEEPROM(uint8_t );
void GetVersionSerial();
void GetConfiguration();
private:
Serial1 CZR_Serial;
void SetOperatingMode(uint8_t mode);
void Command(const char* );
uint32_t Request(const char* );
char buffer[20];
};
#endif
// -- END OF FILE --