[Tastebridge] Incubator Arduino Sketch - update

algoldor at frantisekapfelbeck.org algoldor at frantisekapfelbeck.org
Tue Sep 7 07:02:54 UTC 2010


Some small comments on the arduino sketch for incubator project.

Thanks to All, especially Josh and Mitch! Feel free to tinker or  
correct the comments!

Sincerely,

Frantisek
-------------- next part --------------
?
int analogPin = 0;     // potentiometer wiper (middle terminal) connected to analog pin 3
                       // outside leads to ground and +5V
int val = 0;           // variable to store the value read

int heatled = 5;	// 06/09/2010 ??

int target  = 400;	// 06/09/2010 target temperature

int set = 0;		// 06/09/2010 has no function in this program

int count =0;		// 06/09/2010 ??


void setup()
{
  Serial.begin(9600);          //  setup serial
  pinMode(heatled, OUTPUT);	// 06/09/2010 ??
}

void loop()
{
  val = analogRead(analogPin);	// read the input pin
  Serial.println(val);		// debug value
  if (val < target) {		// 06/09/2010 if the temp less than the target than continue	
    digitalWrite(heatled, HIGH);	// 06/09/2010 turn on the heating element
    Serial.println("heat it up!");	// 06/09/2010 Output to the computer
    set = 1;				// 06/09/2010 serves no purpose
    delay (2000);}			// 06/09/2010 pauses for 2 secs - Not to continuously switch on and off
  if (val > target) {			// 06/09/2010 if the temperature is higher than target increase the count
  count++;}
  
  if (count > 10) {			// 06/09/2010 ?? If the count is greater than 10?
    digitalWrite(heatled, LOW);		// 06/09/2010 turns off the heating element
    delay (2000);			// 06/09/2010 pauses for 2 secs
    count=0;}				// 06/09/2010 resets the count 
    
  
  
  
  }

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Incubator_schematics_fa06092010.odg
Type: application/vnd.oasis.opendocument.graphics
Size: 12601 bytes
Desc: not available
URL: <http://www.noisebridge.net/pipermail/tastebridge/attachments/20100907/ce3c6255/attachment.odg>


More information about the Tastebridge mailing list