fixed crlf for project

This commit is contained in:
Henrik Ekblad
2014-03-07 21:17:56 +01:00
parent 586a4d6239
commit c1441dca4a
62 changed files with 6964 additions and 6964 deletions
+61 -61
View File
@@ -1,62 +1,62 @@
RemoteSensor library v1.0.1 (20120213) for Arduino 1.0
Made by Randy Simons http://randysimons.nl/
This library provides an easy class for Arduino, to send and receive signals
used by some common weather stations using remote 433MHz sensors, like those
made by Cresta.
E.g. http://www.cresta.nl/index.php?Itemid=2&option=com_zoo&view=item&category_id=32&item_id=281&lang=en
Cresta is just a brandname. The original OEM seems to be Hideki Electronics.
There are other brands which use the same hardware and / or protocol. As far
as I know these include Mebus, Irox, Honeywell, Cresta and RST.
This software is based on the work of Oopsje. See docs/CrestaProtocol.pdf
See SensorTransmitter.h and SensorReciver.h for details!
License: GPLv3. See ./RemoteSensor/license.txt
Latest source and wiki: https://bitbucket.org/fuzzillogic/433mhzforarduino
Installation of library:
- Make sure Arduino is closed
- Copy the directory RemoteSensor to the Arduino library directory (usually
<Sketchbook directory>/libraries/)
See http://arduino.cc/en/Guide/Libraries for detailed instructions.
Default installation sender & demo:
- Connect tha data-in-pin of a 433MHz transmitter to digital pin 11. See
docs/hardware setup.jpg.
(Note: your hardware may have a different pin configuration!)
- Start Arduino, and open the example: File -> Examples -> RemoteSensor ->
ThermoHygroTransmitter
- Alter addresses/devices to reflect your own setup. Otherwise nothing will
happen.
- Compile, upload and run!
Default installation receiver & demo:
- Connect the data-out-pin of a 433MHz receiver to digital pin 2. See photo.
(Note: your hardware may have a different pin configuration!)
- Start Arduino, and open the example: File -> Examples -> RemoteSensor ->
ThermoHygroReceiver
- Compile, upload and run
- Open serial monitor in Arduino (115200 baud)
- Wait for your 433MHz-sensor to transmit (less than 1 minute), and watch the
serial monitor
Changelog:
RemoteSensor library v1.0.2 (20130601) for Arduino 1.0
- Reduced memory usage (Flash, RAM). Because of this, a small backwards
incompatibility is introduced: The last parameter of
SensorReceiver::decodeThermoHygro now is a byte instead of short.
- Dropped support for Arduino pre-1.0
RemoteSensor library v1.0.1 (20120213) for Arduino 0022/1.0
- Ignore obviously too short or too long signals in SensorReceiver, for better
recognition rate.
- Support for Arduino 1.0.
RemoteSensor library v1.0.0 (20110919) for Arduino 0022
RemoteSensor library v1.0.1 (20120213) for Arduino 1.0
Made by Randy Simons http://randysimons.nl/
This library provides an easy class for Arduino, to send and receive signals
used by some common weather stations using remote 433MHz sensors, like those
made by Cresta.
E.g. http://www.cresta.nl/index.php?Itemid=2&option=com_zoo&view=item&category_id=32&item_id=281&lang=en
Cresta is just a brandname. The original OEM seems to be Hideki Electronics.
There are other brands which use the same hardware and / or protocol. As far
as I know these include Mebus, Irox, Honeywell, Cresta and RST.
This software is based on the work of Oopsje. See docs/CrestaProtocol.pdf
See SensorTransmitter.h and SensorReciver.h for details!
License: GPLv3. See ./RemoteSensor/license.txt
Latest source and wiki: https://bitbucket.org/fuzzillogic/433mhzforarduino
Installation of library:
- Make sure Arduino is closed
- Copy the directory RemoteSensor to the Arduino library directory (usually
<Sketchbook directory>/libraries/)
See http://arduino.cc/en/Guide/Libraries for detailed instructions.
Default installation sender & demo:
- Connect tha data-in-pin of a 433MHz transmitter to digital pin 11. See
docs/hardware setup.jpg.
(Note: your hardware may have a different pin configuration!)
- Start Arduino, and open the example: File -> Examples -> RemoteSensor ->
ThermoHygroTransmitter
- Alter addresses/devices to reflect your own setup. Otherwise nothing will
happen.
- Compile, upload and run!
Default installation receiver & demo:
- Connect the data-out-pin of a 433MHz receiver to digital pin 2. See photo.
(Note: your hardware may have a different pin configuration!)
- Start Arduino, and open the example: File -> Examples -> RemoteSensor ->
ThermoHygroReceiver
- Compile, upload and run
- Open serial monitor in Arduino (115200 baud)
- Wait for your 433MHz-sensor to transmit (less than 1 minute), and watch the
serial monitor
Changelog:
RemoteSensor library v1.0.2 (20130601) for Arduino 1.0
- Reduced memory usage (Flash, RAM). Because of this, a small backwards
incompatibility is introduced: The last parameter of
SensorReceiver::decodeThermoHygro now is a byte instead of short.
- Dropped support for Arduino pre-1.0
RemoteSensor library v1.0.1 (20120213) for Arduino 0022/1.0
- Ignore obviously too short or too long signals in SensorReceiver, for better
recognition rate.
- Support for Arduino 1.0.
RemoteSensor library v1.0.0 (20110919) for Arduino 0022
- Initial version
+110 -110
View File
@@ -1,111 +1,111 @@
/*
* RemoteSensor library v1.0.2 (20130601) for Arduino 1.0
*
* This library encodes, encrypts en transmits data to
* remote weather stations made by Hideki Electronics..
*
* Copyright 2011-2013 by Randy Simons http://randysimons.nl/
*
* Parts of this code based on Oopsje's CrestaProtocol.pdf, for which
* I thank him very much!
*
* License: GPLv3. See license.txt
*/
#ifndef SensorTransmitter_h
#define SensorTransmitter_h
#include <Arduino.h>
/**
* SensorTransmitter provides a generic class to simulate Cresta weather sensors, for use
* with Cresta weather stations.
* E.g. http://www.cresta.nl/index.php?Itemid=2&option=com_zoo&view=item&category_id=32&item_id=281&lang=en
*
* Cresta is just a brand name. The original OEM seems to be Hideki Electronics. There are
* other brands which use the same hardware and / or protocol. As far as I know these include
* Mebus, Irox, Honeywell, Cresta and RST.
*
* Hardware required for this library: a 433MHz/434MHz SAW oscillator transmitter, e.g.
* http://www.sparkfun.com/products/10534
* http://www.conrad.nl/goto/?product=130428
*/
class SensorTransmitter {
public:
/**
* Initializes the transmitter. About the random id: "A sensor selects a random value
* in the range of column 1 when it is reset. It keeps the same ID until it is reset again."
* You can leave it at 0 for most purposes
* The transmitter pin is set in OUTPUT mode; you don't have to do this yourself.
*
* @param transmitterPin Arduino-pin connected to the 433MHz transmitter
* @param randomId A "random" value in the range [0..31]
*/
SensorTransmitter(byte transmitterPin, byte randomId);
/**
* Sends a raw sensor package. Before transmitting, the data is encrypted and checksums are
* added. The buffer of the data doesn't need to have room for the checksums, as the data is
* copied internally to a new buffer which is always large enough.
* However, the data must be valid!
*
* The data is transmitted 3 times.
*
* Note that this is a static method.
*
* @param transmitterPin Arduino-pin connected to the 433MHz transmitter
* @param data Pointer to data to transmit
*/
static void sendPackage(byte transmitterPin, byte *data);
protected:
byte _transmitterPin;
byte _randomId;
private:
/**
* Sends data as manchester encoded stream
*/
static void sendManchesterPackage(byte transmitterPin, byte *data, byte cnt);
/**
* Sends a single byte as manchester encoded stream
*/
static void sendManchesterByte(byte transmitterPin, byte b);
/**
* Encryption and checksum
*/
static byte encryptAndAddCheck(byte *buffer);
static byte secondCheck(byte b);
static byte encryptByte(byte b);
};
class ThermoHygroTransmitter : public SensorTransmitter {
public:
/**
* Mimics a Thermo / Hygro sensor. The channel of this device can be 1..5, but note
* that only the more expensive receivers can use channels 4 and 5. However, for use
* in conjunction with SensorReceiver this is of no concern.
*
* @param transmitterPin Arduino-pin connected to the 433MHz transmitter
* @param randomId A "random" value in the range [0..31]
* @channel The channel of this sensor, range [1..5]
* @see SensorTransmitter::SensorTransmitter (constructor)
*/
ThermoHygroTransmitter(byte transmitterPin, byte randomId, byte channel);
/**
* Sends temperature and humidity.
*
* @param temperature 10x the actual temperature. You want to send 23,5 degrees, then temperature should be 235.
* @param humidty Humidity in percentage-points REL. Thus, for 34% REH humidity should be 34.
*/
void sendTempHumi(int temperature, byte humidity);
private:
byte _channel; // Note: internally, the channels for the thermo/hygro-sensor are mapped as follow:
// 1=>1, 2=>2, 3=>3, 4=>5, 5=>6.
// This because interally the rain sensor, UV sensor and anemometer are on channel 4.
};
/*
* RemoteSensor library v1.0.2 (20130601) for Arduino 1.0
*
* This library encodes, encrypts en transmits data to
* remote weather stations made by Hideki Electronics..
*
* Copyright 2011-2013 by Randy Simons http://randysimons.nl/
*
* Parts of this code based on Oopsje's CrestaProtocol.pdf, for which
* I thank him very much!
*
* License: GPLv3. See license.txt
*/
#ifndef SensorTransmitter_h
#define SensorTransmitter_h
#include <Arduino.h>
/**
* SensorTransmitter provides a generic class to simulate Cresta weather sensors, for use
* with Cresta weather stations.
* E.g. http://www.cresta.nl/index.php?Itemid=2&option=com_zoo&view=item&category_id=32&item_id=281&lang=en
*
* Cresta is just a brand name. The original OEM seems to be Hideki Electronics. There are
* other brands which use the same hardware and / or protocol. As far as I know these include
* Mebus, Irox, Honeywell, Cresta and RST.
*
* Hardware required for this library: a 433MHz/434MHz SAW oscillator transmitter, e.g.
* http://www.sparkfun.com/products/10534
* http://www.conrad.nl/goto/?product=130428
*/
class SensorTransmitter {
public:
/**
* Initializes the transmitter. About the random id: "A sensor selects a random value
* in the range of column 1 when it is reset. It keeps the same ID until it is reset again."
* You can leave it at 0 for most purposes
* The transmitter pin is set in OUTPUT mode; you don't have to do this yourself.
*
* @param transmitterPin Arduino-pin connected to the 433MHz transmitter
* @param randomId A "random" value in the range [0..31]
*/
SensorTransmitter(byte transmitterPin, byte randomId);
/**
* Sends a raw sensor package. Before transmitting, the data is encrypted and checksums are
* added. The buffer of the data doesn't need to have room for the checksums, as the data is
* copied internally to a new buffer which is always large enough.
* However, the data must be valid!
*
* The data is transmitted 3 times.
*
* Note that this is a static method.
*
* @param transmitterPin Arduino-pin connected to the 433MHz transmitter
* @param data Pointer to data to transmit
*/
static void sendPackage(byte transmitterPin, byte *data);
protected:
byte _transmitterPin;
byte _randomId;
private:
/**
* Sends data as manchester encoded stream
*/
static void sendManchesterPackage(byte transmitterPin, byte *data, byte cnt);
/**
* Sends a single byte as manchester encoded stream
*/
static void sendManchesterByte(byte transmitterPin, byte b);
/**
* Encryption and checksum
*/
static byte encryptAndAddCheck(byte *buffer);
static byte secondCheck(byte b);
static byte encryptByte(byte b);
};
class ThermoHygroTransmitter : public SensorTransmitter {
public:
/**
* Mimics a Thermo / Hygro sensor. The channel of this device can be 1..5, but note
* that only the more expensive receivers can use channels 4 and 5. However, for use
* in conjunction with SensorReceiver this is of no concern.
*
* @param transmitterPin Arduino-pin connected to the 433MHz transmitter
* @param randomId A "random" value in the range [0..31]
* @channel The channel of this sensor, range [1..5]
* @see SensorTransmitter::SensorTransmitter (constructor)
*/
ThermoHygroTransmitter(byte transmitterPin, byte randomId, byte channel);
/**
* Sends temperature and humidity.
*
* @param temperature 10x the actual temperature. You want to send 23,5 degrees, then temperature should be 235.
* @param humidty Humidity in percentage-points REL. Thus, for 34% REH humidity should be 34.
*/
void sendTempHumi(int temperature, byte humidity);
private:
byte _channel; // Note: internally, the channels for the thermo/hygro-sensor are mapped as follow:
// 1=>1, 2=>2, 3=>3, 4=>5, 5=>6.
// This because interally the rain sensor, UV sensor and anemometer are on channel 4.
};
#endif
@@ -51,4 +51,4 @@ void retransmit(byte *data) {
noInterrupts();
SensorReceiver::enable();
}
@@ -25,4 +25,4 @@
// Wait two seconds before sending next.
delay(2000);
}
}
}
+8 -8
View File
@@ -1,9 +1,9 @@
SensorReceiver KEYWORD1
init KEYWORD2
decodeThermoHygro KEYWORD2
enable KEYWORD2
disable KEYWORD2
interruptHandler KEYWORD2
SensorTransmitter KEYWORD1
sendPackage KEYWORD2
SensorReceiver KEYWORD1
init KEYWORD2
decodeThermoHygro KEYWORD2
enable KEYWORD2
disable KEYWORD2
interruptHandler KEYWORD2
SensorTransmitter KEYWORD1
sendPackage KEYWORD2
ThermoHygroTransmitter KEYWORD1