Monday, October 31, 2011
Thursday, October 27, 2011
Smart Systems
I've been working on creating a system where Audrino gathers information from instruments and sends it to Processing which would then send it onto Pachube so it can be recorded. Ive chosen this method over using a Ethernet shield--> as I find it simpler and also cheaper even though the draw backs of this method is that i have to leave a computer within close proximity to collect the data, it is possible that I could hook this system up to a Wifi shield--> to solve this problem but again I would have to go out and buy this when I'm currently busy working on our Orbitropic mechanism which seems to be filling my time quite well. The plan is to use this system to accumulate the data from our sensors in the orbitropic system and plot this online to give us an idea of how the plants are growing and what the best environment is for them allowing us to monitor and make changes accordingly.
Tuesday, October 25, 2011
Arduino Smart Systems
A path I could venture down with this project is controlling Arduino via Html. So making changes through the internet such as increasing the watering time, extending the length of time the lights are on or off, control the Ph balance as they might grow better being slightly more acidic or slightly more alkaline. I don't know much about this method but I have been reading up on it and it would be an awesome feature to have but i don't think my skills quite encompass this yet.
Tuesday, September 6, 2011
Arduino Code
#include
byte analogPin = 0;
void analogWriteCallback(byte pin, int value)
{
if (IS_PIN_PWM(pin)) {
pinMode(PIN_TO_DIGITAL(pin), OUTPUT);
analogWrite(PIN_TO_PWM(pin), value);
}
}
void setup()
{
Firmata.setFirmwareVersion(0, 1);
Firmata.attach(ANALOG_MESSAGE, analogWriteCallback);
Firmata.begin(57600);
}
void loop()
{
while(Firmata.available()) {
Firmata.processInput();
}
Firmata.sendAnalog(analogPin, analogRead(analogPin));
analogPin = analogPin + 1;
if (analogPin >= TOTAL_ANALOG_PINS) analogPin = 0;
}
byte analogPin = 0;
void analogWriteCallback(byte pin, int value)
{
if (IS_PIN_PWM(pin)) {
pinMode(PIN_TO_DIGITAL(pin), OUTPUT);
analogWrite(PIN_TO_PWM(pin), value);
}
}
void setup()
{
Firmata.setFirmwareVersion(0, 1);
Firmata.attach(ANALOG_MESSAGE, analogWriteCallback);
Firmata.begin(57600);
}
void loop()
{
while(Firmata.available()) {
Firmata.processInput();
}
Firmata.sendAnalog(analogPin, analogRead(analogPin));
analogPin = analogPin + 1;
if (analogPin >= TOTAL_ANALOG_PINS) analogPin = 0;
}
Saturday, August 6, 2011
Processing Code
import processing.serial.*;
Serial myPort;
int xPos = 1;
void setup () {
size(400, 300);
println(Serial.list());
myPort = new Serial(this, Serial.list()[0], 9600);
myPort.bufferUntil('\n');
background(0);
}
void draw () {
}
void serialEvent (Serial myPort) {
String inString = myPort.readStringUntil('\n');
if (inString != null) {
inString = trim(inString);
float inByte = float(inString);
inByte = map(inByte, 0, 1023, 0, height);
stroke(127,34,255);
line(xPos, height, xPos, height - inByte);
if (xPos >= width) {
xPos = 0;
background(0);
}
else {
xPos++;
}
}
}
Serial myPort;
int xPos = 1;
void setup () {
size(400, 300);
println(Serial.list());
myPort = new Serial(this, Serial.list()[0], 9600);
myPort.bufferUntil('\n');
background(0);
}
void draw () {
}
void serialEvent (Serial myPort) {
String inString = myPort.readStringUntil('\n');
if (inString != null) {
inString = trim(inString);
float inByte = float(inString);
inByte = map(inByte, 0, 1023, 0, height);
stroke(127,34,255);
line(xPos, height, xPos, height - inByte);
if (xPos >= width) {
xPos = 0;
background(0);
}
else {
xPos++;
}
}
}
Monday, November 1, 2010
Wednesday, October 27, 2010
Subscribe to:
Posts (Atom)