It has been some months since I work on the assembly and the program of the optical fork "Omron EE-SG3B"
I would like some advice or help advance my project!
thank you
Have you tried doing something?
Yes, here is my program, but no response from the periodic signal at the output of the fork.
//===Détection de présence avec une fourche optique
// tiptopboards 22 08 2013
//
// Branchement du capteur sur pin5 digital
//==========================================================
// Pins utilisées
const int fourchePin = 5; //Sortie de la fourche pin5
const int ledPin = 9; // LED témoin sur pin
int EtatFourche =0 ;
// Initialisation
void setup() {
Serial.begin(9600); //connection au port série
pinMode(ledPin, OUTPUT); //LED en sortie
pinMode(fourchePin, INPUT); //en entrée
Serial.println("Fourche optique - detection de presence");
}
//=== Boucle de mesures
void loop() {
//Vérifie si un objet obture la fourche optique
EtatFourche = digitalRead(fourchePin);
Serial.print("Etat ");
if (EtatFourche == HIGH) {
// Allumer la LED témoin
digitalWrite(ledPin, HIGH);
Serial.println("Presence");
}
else {
// Eteindre la LED
digitalWrite(ledPin, LOW);
Serial.println("Vide");
}
delay(200);
}