Thought it was about time for me to finally get back to work and make my X10 irrigation work.
So now I have added a 4 port relay card to the project to control my zones and have broken out the code to be in functions for controlling the interface. I also have moved over to using a 16*16 array for storage of all the settings for the controls.
I still need to set up the relays to use X10 dimming code to set a timer limit for the outputs and then it will just need to be wired up.
Have a look at the code over at https://github.com/jlcox1970/arduino
Happy days
Showing posts with label arduino. Show all posts
Showing posts with label arduino. Show all posts
Thursday, 25 September 2014
Friday, 3 January 2014
Autopilot has arrived
In record time the APM arrived today.
Now coming to grips with qgroundcontrol as MissionPlanner requires Windows which I dont have.
Next to connect it up to both the plane and the raspberrypi
Now coming to grips with qgroundcontrol as MissionPlanner requires Windows which I dont have.
Next to connect it up to both the plane and the raspberrypi
The APM is in the middle, compass/gps on the left and the battery voltage/current sensor at the bottom.
Friday, 27 December 2013
Auto Pilot ordered
I finally order a Auto Pilot for the glider.
I found that there was a $40 discount until the end of next week. That more then makes up for the low $AU
Now to start on an AuduPilot Glider version
I found that there was a $40 discount until the end of next week. That more then makes up for the low $AU
Now to start on an AuduPilot Glider version
Tuesday, 18 June 2013
Changes to Arduino 1.0
I tried to make buildbot build my old X10 automation code and found some issues.
The builds kept breaking with errors around WProgram.h
Turns out that the new version needs this to be changed over to Arduino.h
So how to do this? Easy when you run Linux.
1. Change to the base code direcrtory.
2. run the following little bit of bash code
for i in `find`
do
sed 's/WProgram.h/Arduino.h/g' -i $i
done
The builds kept breaking with errors around WProgram.h
Turns out that the new version needs this to be changed over to Arduino.h
So how to do this? Easy when you run Linux.
1. Change to the base code direcrtory.
2. run the following little bit of bash code
for i in `find`
do
sed 's/WProgram.h/Arduino.h/g' -i $i
done
Return to buildbot
As my glider takes shape and starting to get towards being "flight ready" I find it is time to start looking at the software that will run on it.
So what will the plane be running?
1. An autopilot and that will be ardupilot as it is very stable and will not need much modification and any that are needed can be contributed back to open source.
2. Some form of image software for building a point cloud from an un-ordered set of images.
3. Sync software for downloading data once it back in range automatically. Then of course is what platform will all this be running on.
The autopilot will be running in an arduino mega and the other software will be on single board Linux PC. It is looking like the Linux platform will be on a RaspberryPI if I can get openCV running smoothly. Time will tell.
So after dusting off my old configurations for buildbot and setting up the new master, gitolite server and gitweb access on my ec2 instance it was time to start testing.
First problem was setting up all those ssh keys for each of the build servers so that I can build code for each of the platforms.
The RaspberryPI and the main x86_64 buildbot slaves were easy and just needed to install via "easy_install buildbot-slave" and then configure. Simple.
The master out on ec2 was harder but only in that I had to install via source from git.
So what will the plane be running?
1. An autopilot and that will be ardupilot as it is very stable and will not need much modification and any that are needed can be contributed back to open source.
2. Some form of image software for building a point cloud from an un-ordered set of images.
3. Sync software for downloading data once it back in range automatically. Then of course is what platform will all this be running on.
The autopilot will be running in an arduino mega and the other software will be on single board Linux PC. It is looking like the Linux platform will be on a RaspberryPI if I can get openCV running smoothly. Time will tell.
So after dusting off my old configurations for buildbot and setting up the new master, gitolite server and gitweb access on my ec2 instance it was time to start testing.
First problem was setting up all those ssh keys for each of the build servers so that I can build code for each of the platforms.
The RaspberryPI and the main x86_64 buildbot slaves were easy and just needed to install via "easy_install buildbot-slave" and then configure. Simple.
The master out on ec2 was harder but only in that I had to install via source from git.
Sunday, 22 April 2012
More Arduino X10 work
So I have now made an subversion repository available for the X10 work I have been doing as I am looking forward to returning to development and extending the libraries that it uses. Access is via the following url (hosted on EC2 servers) and all feedback is welcomed.
https://globelock.dyndns.info/svn/arduino/
Any changes can be posted back as a comment to the blog and I will incorporate them for you :)
https://globelock.dyndns.info/svn/arduino/
Any changes can be posted back as a comment to the blog and I will incorporate them for you :)
Sunday, 3 July 2011
Command Line Programming The Arduino
So more on the Buildbot and command line compiles of the arduino.
After using some code and instructions found here I found that I could compile code (only if the library had been compiled first) however I was unable to upload it to my board.
After lots of looking around for a solution I work out that if I write a wrapper for the arduino's avrdude I could get the correct param's for the upload.
Turns out that the Make file was set for 19200 but the chip wants 57600.
So now to test out the latest version of the Arduino.mk file to see if it builds the library correctly.
UPDATE: once setup Arduino-mk-0.5 works apart from upload which needs the baud rate changed to 57600 for the ATMega328
After using some code and instructions found here I found that I could compile code (only if the library had been compiled first) however I was unable to upload it to my board.
After lots of looking around for a solution I work out that if I write a wrapper for the arduino's avrdude I could get the correct param's for the upload.
Turns out that the Make file was set for 19200 but the chip wants 57600.
So now to test out the latest version of the Arduino.mk file to see if it builds the library correctly.
UPDATE: once setup Arduino-mk-0.5 works apart from upload which needs the baud rate changed to 57600 for the ATMega328
Buildbot on Arduino
Well after much trialling I can now report that I can continuously compile my arduino code with buildbot.
The plan is now to use eclipse as programming tool and compile projects by simply committing back to SVN.
Still have to get the auto program side working, but I am not far off
The plan is now to use eclipse as programming tool and compile projects by simply committing back to SVN.
Still have to get the auto program side working, but I am not far off
Sunday, 27 February 2011
Arduino two way comunication over DC
So the reason that I have gotten an Arduino is so that I can build a sensor/control network primarily targeted at sprinkler systems.
The idea is that I can have the following
PSC05 <=> arduino controller <=> station 1 <=> station 2 <=> ......
At the moment I have the PSC05 and controller work, now onto the fun bit.
My thoughts are to use the zero crossing signal as a master clock for all comms and to transpose the tx/rx signal onto the same line. Then use LC coupling onto the DC supply.
I am hoping that this will allow for easy reuse of the X10 Lib that the controller is using.
The idea is that I can have the following
PSC05 <=> arduino controller <=> station 1 <=> station 2 <=> ......
At the moment I have the PSC05 and controller work, now onto the fun bit.
My thoughts are to use the zero crossing signal as a master clock for all comms and to transpose the tx/rx signal onto the same line. Then use LC coupling onto the DC supply.
I am hoping that this will allow for easy reuse of the X10 Lib that the controller is using.
Sunday, 20 February 2011
Arduino X10 temperature library
Time to release the temperature library I have been working on... ( there has to be a better way )
It turns out that what is required is a response to a status request to send back the temperature using preset dim commands. The results are a rcs type sensor
/*
x10.cpp - X10 transmission library for Arduino version 0.3
Original library (0.1) by Tom Igoe.
Timing bug fixes (0.2) " " "
#include bug fixes for 0012 (0.3) " " "
Temperature Sensing (0.4) by Jason Cox
Zero crossing algorithms borrowed from David Mellis' shiftOut command
for Arduino.
The circuits can be found at
http://www.arduino.cc/en/Tutorial/x10
*/
#include
#include "WProgram.h"
#include "x10.h"
#include "x10constants.h"
/*
Constructor.
Sets the pins and sets their I/O modes.
*/
x10::x10(int zeroCrossingPin, int dataPin)
{
this->zeroCrossingPin = zeroCrossingPin; // the zero crossing pin
this->dataPin = dataPin; // the output data pin
// Set I/O modes:
pinMode(this->zeroCrossingPin, INPUT);
pinMode(this->dataPin, OUTPUT);
}
/*
Writes an X10 command out to the X10 modem
*/
void x10::write(byte houseCode, byte numberCode, int numRepeats) {
byte startCode = B1110; // every X10 command starts with this
// repeat as many times as requested:
for (int i = 0; i < numRepeats; i++) {
// send the three parts of the command:
sendBits(startCode, 4, true);
sendBits(houseCode, 4, false);
sendBits(numberCode, 5, false);
}
// if this isn't a bright or dim command, it should be followed by
// a delay of 3 power cycles (or 6 zero crossings):
if ((numberCode != BRIGHT) && (numberCode != DIM)) {
waitForZeroCross(this->zeroCrossingPin, 6);
}
}
/*
Writes a sequence of bits out. If the sequence is not a start code,
it repeats the bits, inverting them.
*/
void x10::sendBits(byte cmd, byte numBits, byte isStartCode) {
byte thisBit; // copy of command so we can shift bits
// iterate the number of bits to be shifted:
for(int i=1; i<=numBits; i++) {
// wait for a zero crossing change:
waitForZeroCross(this->zeroCrossingPin, 1);
// shift off the last bit of the command:
thisBit = !!(cmd & (1 << (numBits - i)));
// repeat once for each phase:
for (int phase = 0; phase < 3; phase++) {
// set the data Pin:
digitalWrite(this->dataPin, thisBit);
delayMicroseconds(BIT_LENGTH);
// clear the data pin:
digitalWrite(this->dataPin, LOW);
delayMicroseconds(BIT_DELAY);
}
// if this command is a start code, don't
// send its complement. Otherwise do:
if(!isStartCode) {
// wait for zero crossing:
waitForZeroCross(zeroCrossingPin, 1);
for (int phase = 0; phase < 3; phase++) {
// set the data pin:
digitalWrite(this->dataPin, !thisBit);
delayMicroseconds(BIT_LENGTH);
// clear the data pin:
digitalWrite(dataPin, LOW);
delayMicroseconds(BIT_DELAY);
}
}
}
}
/*
waits for a the zero crossing pin to cross zero
*/
void x10::waitForZeroCross(int pin, int howManyTimes) {
unsigned long cycleTime = 0;
// cache the port and bit of the pin in order to speed up the
// pulse width measuring loop and achieve finer resolution. calling
// digitalRead() instead yields much coarser resolution.
uint8_t bit = digitalPinToBitMask(pin);
uint8_t port = digitalPinToPort(pin);
for (int i = 0; i < howManyTimes; i++) {
// wait for pin to change:
if((*portInputRegister(port) & bit))
while((*portInputRegister(port) & bit))
cycleTime++;
else
while(!(*portInputRegister(port) & bit))
cycleTime++;
}
}
/*
version() returns the version of the library:
*/
int x10::version(void)
{
return 3;
}
void x10::x10temp (byte temp_houseCode, byte tmep_Unit, int count, int RPT_SEND){
detachInterrupt(0); // must detach interrupt before sending
x10::write(temp_houseCode ,tmep_Unit ,RPT_SEND);
x10::write(temp_houseCode ,UNIT_13 ,RPT_SEND);
switch (count) {
case 0:
x10::write(M,PRE_SET_DIM,RPT_SEND);
break;
case 1:
x10::write(N,PRE_SET_DIM,RPT_SEND);
break;
case 2:
x10::write(O,PRE_SET_DIM,RPT_SEND);
break;
case 3:
x10::write(P,PRE_SET_DIM,RPT_SEND);
break;
case 4:
x10::write(C,PRE_SET_DIM,RPT_SEND);
break;
case 5:
x10::write(D,PRE_SET_DIM,RPT_SEND);
break;
case 6:
x10::write(A,PRE_SET_DIM,RPT_SEND);
break;
case 7:
x10::write(B,PRE_SET_DIM,RPT_SEND);
break;
case 8:
x10::write(E,PRE_SET_DIM,RPT_SEND);
break;
case 9:
x10::write(F,PRE_SET_DIM,RPT_SEND);
break;
case 10:
x10::write(G,PRE_SET_DIM,RPT_SEND);
break;
case 11:
x10::write(H,PRE_SET_DIM,RPT_SEND);
break;
case 12:
x10::write(K,PRE_SET_DIM,RPT_SEND);
break;
case 13:
x10::write(L,PRE_SET_DIM,RPT_SEND);
break;
case 14:
x10::write(I,PRE_SET_DIM,RPT_SEND);
break;
case 15:
x10::write(J,PRE_SET_DIM,RPT_SEND);
break;
case 16:
x10::write(M,PRE_SET_DIM2,RPT_SEND);
break;
case 17:
x10::write(N,PRE_SET_DIM2,RPT_SEND);
break;
case 18:
x10::write(O,PRE_SET_DIM2,RPT_SEND);
break;
case 19:
x10::write(P,PRE_SET_DIM2,RPT_SEND);
break;
case 20:
x10::write(C,PRE_SET_DIM2,RPT_SEND);
break;
case 21:
x10::write(D,PRE_SET_DIM2,RPT_SEND);
break;
case 22:
x10::write(A,PRE_SET_DIM2,RPT_SEND);
break;
case 23:
x10::write(B,PRE_SET_DIM2,RPT_SEND);
break;
case 24:
x10::write(E,PRE_SET_DIM2,RPT_SEND);
break;
case 25:
x10::write(F,PRE_SET_DIM2,RPT_SEND);
break;
case 26:
x10::write(G,PRE_SET_DIM2,RPT_SEND);
break;
case 27:
x10::write(H,PRE_SET_DIM2,RPT_SEND);
break;
case 28:
x10::write(K,PRE_SET_DIM2,RPT_SEND);
break;
case 29:
x10::write(L,PRE_SET_DIM2,RPT_SEND);
break;
case 30:
x10::write(I,PRE_SET_DIM2,RPT_SEND);
break;
case 31:
x10::write(J,PRE_SET_DIM2,RPT_SEND);
break;
}
}
and x10.h
/*
Original library (0.1) by Tom Igoe.
Timing bug fixes (0.2) " " "
Temperature (0.3) by Jason Cox
Sends X10 commands.
*/
// ensure this library description is only included once
#ifndef x10_h
#define x10_h
// include types & constants of Wiring core API
#include
#include "WProgram.h"
#include "pins_arduino.h"
// library interface description
class x10 {
public:
// constructors:
x10(int zeroCrossingPin, int dataPin);
// write command method:
void write(byte houseCode, byte numberCode, int numRepeats);
// returns the version number:
int version(void);
void x10temp(byte tmep_houseCode, byte temp_Unit , int count, int RPT_SEND);
private:
int zeroCrossingPin; // AC zero crossing pin
int dataPin; // data out pin
// sends the individual bits of the commands:
void sendBits(byte cmd, byte numBits, byte isStartCode);
// checks for AC zero crossing
void waitForZeroCross(int pin, int howManyTimes);
};
#endif
Lastly the constants file (added preset dim2)
#define HIGH 0x1
#define LOW 0x0
#define BIT_DELAY 2133 // 1778 us between bit repeats in a half-cycle
#define BIT_LENGTH 900 // each bit is slightly less than 1ms long
#define A B0110
#define B B1110
#define C B0010
#define D B1010
#define E B0001
#define F B1001
#define G B0101
#define H B1101
#define I B0111
#define J B1111
#define K B0011
#define L B1011
#define M B0000
#define N B1000
#define O B0100
#define P B1100
#define UNIT_1 B01100
#define UNIT_2 B11100
#define UNIT_3 B00100
#define UNIT_4 B10100
#define UNIT_5 B00010
#define UNIT_6 B10010
#define UNIT_7 B01010
#define UNIT_8 B11010
#define UNIT_9 B01110
#define UNIT_10 B11110
#define UNIT_11 B00110
#define UNIT_12 B10110
#define UNIT_13 B00000
#define UNIT_14 B10000
#define UNIT_15 B01000
#define UNIT_16 B11000
#define ALL_UNITS_OFF B00001
#define ALL_LIGHTS_ON B00011
#define ON B00101
#define OFF B00111
#define DIM B01001
#define BRIGHT B01011
#define ALL_LIGHTS_OFF B01101
#define EXTENDED_CODE B01111
#define HAIL_REQUEST B10001
#define HAIL_ACKNOWLEDGE B10011
#define PRE_SET_DIM B10101
#define PRE_SET_DIM2 B10111
#define EXTENDED_DATA B11001
#define STATUS_ON B11011
#define STATUS_OFF B11101
#define STATUS_REQUEST B11111
It turns out that what is required is a response to a status request to send back the temperature using preset dim commands. The results are a rcs type sensor
/*
x10.cpp - X10 transmission library for Arduino version 0.3
Original library (0.1) by Tom Igoe.
Timing bug fixes (0.2) " " "
#include bug fixes for 0012 (0.3) " " "
Temperature Sensing (0.4) by Jason Cox
Zero crossing algorithms borrowed from David Mellis' shiftOut command
for Arduino.
The circuits can be found at
http://www.arduino.cc/en/Tutorial/x10
*/
#include
#include "WProgram.h"
#include "x10.h"
#include "x10constants.h"
/*
Constructor.
Sets the pins and sets their I/O modes.
*/
x10::x10(int zeroCrossingPin, int dataPin)
{
this->zeroCrossingPin = zeroCrossingPin; // the zero crossing pin
this->dataPin = dataPin; // the output data pin
// Set I/O modes:
pinMode(this->zeroCrossingPin, INPUT);
pinMode(this->dataPin, OUTPUT);
}
/*
Writes an X10 command out to the X10 modem
*/
void x10::write(byte houseCode, byte numberCode, int numRepeats) {
byte startCode = B1110; // every X10 command starts with this
// repeat as many times as requested:
for (int i = 0; i < numRepeats; i++) {
// send the three parts of the command:
sendBits(startCode, 4, true);
sendBits(houseCode, 4, false);
sendBits(numberCode, 5, false);
}
// if this isn't a bright or dim command, it should be followed by
// a delay of 3 power cycles (or 6 zero crossings):
if ((numberCode != BRIGHT) && (numberCode != DIM)) {
waitForZeroCross(this->zeroCrossingPin, 6);
}
}
/*
Writes a sequence of bits out. If the sequence is not a start code,
it repeats the bits, inverting them.
*/
void x10::sendBits(byte cmd, byte numBits, byte isStartCode) {
byte thisBit; // copy of command so we can shift bits
// iterate the number of bits to be shifted:
for(int i=1; i<=numBits; i++) {
// wait for a zero crossing change:
waitForZeroCross(this->zeroCrossingPin, 1);
// shift off the last bit of the command:
thisBit = !!(cmd & (1 << (numBits - i)));
// repeat once for each phase:
for (int phase = 0; phase < 3; phase++) {
// set the data Pin:
digitalWrite(this->dataPin, thisBit);
delayMicroseconds(BIT_LENGTH);
// clear the data pin:
digitalWrite(this->dataPin, LOW);
delayMicroseconds(BIT_DELAY);
}
// if this command is a start code, don't
// send its complement. Otherwise do:
if(!isStartCode) {
// wait for zero crossing:
waitForZeroCross(zeroCrossingPin, 1);
for (int phase = 0; phase < 3; phase++) {
// set the data pin:
digitalWrite(this->dataPin, !thisBit);
delayMicroseconds(BIT_LENGTH);
// clear the data pin:
digitalWrite(dataPin, LOW);
delayMicroseconds(BIT_DELAY);
}
}
}
}
/*
waits for a the zero crossing pin to cross zero
*/
void x10::waitForZeroCross(int pin, int howManyTimes) {
unsigned long cycleTime = 0;
// cache the port and bit of the pin in order to speed up the
// pulse width measuring loop and achieve finer resolution. calling
// digitalRead() instead yields much coarser resolution.
uint8_t bit = digitalPinToBitMask(pin);
uint8_t port = digitalPinToPort(pin);
for (int i = 0; i < howManyTimes; i++) {
// wait for pin to change:
if((*portInputRegister(port) & bit))
while((*portInputRegister(port) & bit))
cycleTime++;
else
while(!(*portInputRegister(port) & bit))
cycleTime++;
}
}
/*
version() returns the version of the library:
*/
int x10::version(void)
{
return 3;
}
void x10::x10temp (byte temp_houseCode, byte tmep_Unit, int count, int RPT_SEND){
detachInterrupt(0); // must detach interrupt before sending
x10::write(temp_houseCode ,tmep_Unit ,RPT_SEND);
x10::write(temp_houseCode ,UNIT_13 ,RPT_SEND);
switch (count) {
case 0:
x10::write(M,PRE_SET_DIM,RPT_SEND);
break;
case 1:
x10::write(N,PRE_SET_DIM,RPT_SEND);
break;
case 2:
x10::write(O,PRE_SET_DIM,RPT_SEND);
break;
case 3:
x10::write(P,PRE_SET_DIM,RPT_SEND);
break;
case 4:
x10::write(C,PRE_SET_DIM,RPT_SEND);
break;
case 5:
x10::write(D,PRE_SET_DIM,RPT_SEND);
break;
case 6:
x10::write(A,PRE_SET_DIM,RPT_SEND);
break;
case 7:
x10::write(B,PRE_SET_DIM,RPT_SEND);
break;
case 8:
x10::write(E,PRE_SET_DIM,RPT_SEND);
break;
case 9:
x10::write(F,PRE_SET_DIM,RPT_SEND);
break;
case 10:
x10::write(G,PRE_SET_DIM,RPT_SEND);
break;
case 11:
x10::write(H,PRE_SET_DIM,RPT_SEND);
break;
case 12:
x10::write(K,PRE_SET_DIM,RPT_SEND);
break;
case 13:
x10::write(L,PRE_SET_DIM,RPT_SEND);
break;
case 14:
x10::write(I,PRE_SET_DIM,RPT_SEND);
break;
case 15:
x10::write(J,PRE_SET_DIM,RPT_SEND);
break;
case 16:
x10::write(M,PRE_SET_DIM2,RPT_SEND);
break;
case 17:
x10::write(N,PRE_SET_DIM2,RPT_SEND);
break;
case 18:
x10::write(O,PRE_SET_DIM2,RPT_SEND);
break;
case 19:
x10::write(P,PRE_SET_DIM2,RPT_SEND);
break;
case 20:
x10::write(C,PRE_SET_DIM2,RPT_SEND);
break;
case 21:
x10::write(D,PRE_SET_DIM2,RPT_SEND);
break;
case 22:
x10::write(A,PRE_SET_DIM2,RPT_SEND);
break;
case 23:
x10::write(B,PRE_SET_DIM2,RPT_SEND);
break;
case 24:
x10::write(E,PRE_SET_DIM2,RPT_SEND);
break;
case 25:
x10::write(F,PRE_SET_DIM2,RPT_SEND);
break;
case 26:
x10::write(G,PRE_SET_DIM2,RPT_SEND);
break;
case 27:
x10::write(H,PRE_SET_DIM2,RPT_SEND);
break;
case 28:
x10::write(K,PRE_SET_DIM2,RPT_SEND);
break;
case 29:
x10::write(L,PRE_SET_DIM2,RPT_SEND);
break;
case 30:
x10::write(I,PRE_SET_DIM2,RPT_SEND);
break;
case 31:
x10::write(J,PRE_SET_DIM2,RPT_SEND);
break;
}
}
and x10.h
/*
Original library (0.1) by Tom Igoe.
Timing bug fixes (0.2) " " "
Temperature (0.3) by Jason Cox
Sends X10 commands.
*/
// ensure this library description is only included once
#ifndef x10_h
#define x10_h
// include types & constants of Wiring core API
#include
#include "WProgram.h"
#include "pins_arduino.h"
// library interface description
class x10 {
public:
// constructors:
x10(int zeroCrossingPin, int dataPin);
// write command method:
void write(byte houseCode, byte numberCode, int numRepeats);
// returns the version number:
int version(void);
void x10temp(byte tmep_houseCode, byte temp_Unit , int count, int RPT_SEND);
private:
int zeroCrossingPin; // AC zero crossing pin
int dataPin; // data out pin
// sends the individual bits of the commands:
void sendBits(byte cmd, byte numBits, byte isStartCode);
// checks for AC zero crossing
void waitForZeroCross(int pin, int howManyTimes);
};
#endif
Lastly the constants file (added preset dim2)
#define LOW 0x0
#define BIT_DELAY 2133 // 1778 us between bit repeats in a half-cycle
#define BIT_LENGTH 900 // each bit is slightly less than 1ms long
#define A B0110
#define B B1110
#define C B0010
#define D B1010
#define E B0001
#define F B1001
#define G B0101
#define H B1101
#define I B0111
#define J B1111
#define K B0011
#define L B1011
#define M B0000
#define N B1000
#define O B0100
#define P B1100
#define UNIT_1 B01100
#define UNIT_2 B11100
#define UNIT_3 B00100
#define UNIT_4 B10100
#define UNIT_5 B00010
#define UNIT_6 B10010
#define UNIT_7 B01010
#define UNIT_8 B11010
#define UNIT_9 B01110
#define UNIT_10 B11110
#define UNIT_11 B00110
#define UNIT_12 B10110
#define UNIT_13 B00000
#define UNIT_14 B10000
#define UNIT_15 B01000
#define UNIT_16 B11000
#define ALL_UNITS_OFF B00001
#define ALL_LIGHTS_ON B00011
#define ON B00101
#define OFF B00111
#define DIM B01001
#define BRIGHT B01011
#define ALL_LIGHTS_OFF B01101
#define EXTENDED_CODE B01111
#define HAIL_REQUEST B10001
#define HAIL_ACKNOWLEDGE B10011
#define PRE_SET_DIM B10101
#define PRE_SET_DIM2 B10111
#define EXTENDED_DATA B11001
#define STATUS_ON B11011
#define STATUS_OFF B11101
#define STATUS_REQUEST B11111
Cheap Atmeg328
I wanted to start using Arduino after talking to a co-worker about his experiences with it.
I sourced the processor and resonator from an ebay seller (why can I get it this way for less than Jaycar?).
So once the parts arrived it was onto my plan to make a X10 garden sprinkler control.
First it was onto finding a library for X10 control. After much research I found on at BroHogan.
This covered the basics of send and receive but I also decided that I wanted temperature sensors. The solution came whilst reading one of the manuals for Heyu. This showed the basic algorithm for temperature sensing. I extended the library to include it and also responding to status requests.
I sourced the processor and resonator from an ebay seller (why can I get it this way for less than Jaycar?).
So once the parts arrived it was onto my plan to make a X10 garden sprinkler control.
First it was onto finding a library for X10 control. After much research I found on at BroHogan.
This covered the basics of send and receive but I also decided that I wanted temperature sensors. The solution came whilst reading one of the manuals for Heyu. This showed the basic algorithm for temperature sensing. I extended the library to include it and also responding to status requests.
Subscribe to:
Posts (Atom)