CEB Control Code: Difference between revisions

From Open Source Ecology
Jump to navigation Jump to search
No edit summary
 
(27 intermediate revisions by 5 users not shown)
Line 1: Line 1:
=Introduction=
#REDIRECT [[CEB Press/Manufacturing Instructions/Controller Box/Source Code]]
 
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);}
}
 
 
[[Category:Code]][[Category:CEB Control Code]]

Latest revision as of 08:01, 28 January 2012