CEB Control Code

From Open Source Ecology
Revision as of 16:56, 22 April 2010 by WikiSysop (talk | contribs)
Jump to navigation Jump to search

Introduction

The latest code as of 4.22.10 is;

//Notes: In every WHILE loop, shut off solenoids explicitly after //escaping from the loop. Orientation is defined by machine user //facing the control panel. 2 magnets (sensor actuators) are used //for main cylinder, 4 magnets for soil drawer, and 2 magnets are //are used for soil grate shaker. Copyright April 2010, Creative //Commons CC-BY-SA-compatible OSE License, by Marcin Jakubowski, //Ph.D., for OSE. This code and other documentation is available //at the Open+Pario project management site under the CEB Project, //under Documents - Liberator Beta 2.0 Control Code, //http://openpario.net/projects/OSE?

Code

int val3; void setup(){

 Serial.begin(9600); 
 pinMode(17,INPUT);//Digital 17 is Analog 3
 pinMode(11, OUTPUT);


} void loop(){

 val3=analogRead(3);//read Hall effect sensor
 Serial.println(val3);
 
 if(val3>500){
   digitalWrite(11, HIGH);
 }
 else{
   digitalWrite(11, LOW);}

}