CEB Control Code: Difference between revisions
Jump to navigation
Jump to search
(Created page with 'The latest code as of 4.15.10 is; //Notes: In every WHILE loop, shut off solenoids explicitly after //escaping from the loop. Orientation is defined by machine user //facing th…') |
No edit summary |
||
Line 1: | Line 1: | ||
The latest code as of 4. | =Introduction= | ||
The latest code as of 4.22.10 is; | |||
//Notes: In every WHILE loop, shut off solenoids explicitly after | //Notes: In every WHILE loop, shut off solenoids explicitly after | ||
Line 12: | Line 14: | ||
//http://openpario.net/projects/OSE? | //http://openpario.net/projects/OSE? | ||
=Code= | |||
int | int val3; | ||
void setup(){ | void setup(){ | ||
Serial.begin(9600); | Serial.begin(9600); | ||
pinMode( | pinMode(17,INPUT);//Digital 17 is Analog 3 | ||
pinMode(11, OUTPUT); | |||
pinMode( | |||
} | } | ||
void loop(){ | void loop(){ | ||
val3=analogRead(3);//read Hall effect sensor | |||
Serial.println(val3); | |||
// | |||
Serial.println( | |||
if(val3>500){ | |||
digitalWrite(11, HIGH); | |||
digitalWrite( | |||
} | } | ||
else{ | |||
digitalWrite(11, LOW);} | |||
} | |||
digitalWrite( | |||
} | |||
[[Category:Code]] | [[Category:Code]][[Category:CEB Control Code]] |
Revision as of 16:56, 22 April 2010
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);}
}