CEB Automation Sensor Code

From Open Source Ecology
Revision as of 03:51, 12 March 2010 by WikiSysop (talk | contribs) (Created page with 'Here is Arduino programming language (sketch) for the analog Hall effect sensors: =Simple Test 1= //begin //note - digital pins 0-13 //note - analog pins 14-19 //define initial…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Here is Arduino programming language (sketch) for the analog Hall effect sensors:

Simple Test 1

//begin //note - digital pins 0-13 //note - analog pins 14-19 //define initial function (void because it creates no output)

void setup(){

 pinMode(14,INPUT);//corresponds to analog input 0
 pinMode(5, OUTPUT);
 pinMode(6, OUTPUT);
 digitalWrite(5, HIGH);

}

//define ongoing loop void loop(){} //end

Working Test Code for the Main Cylinder: bouncing up and down between two sensors

//begin

void setup(){

 pinMode(14,INPUT);//corresponds to analog input 0
 pinMode(5, OUTPUT);//corresponds to solenoid - cylinder up
 pinMode(6, OUTPUT);//corresponds to solenoid - cylinder down

}

//define ongoing loop void loop(){

 digitalWrite(5, HIGH);
 analogRead(14,

}

//en