Objectifs

  1. Savoir le fonctionnement d’une touche optique
  2. Savoir utiliser un détecteur IR
  3. Savoir filtrer un signal TOR avec Arduino
  4. Savoir régler le seuil de sensibilité
  5. Etc.

Voir le tuto pour plus de détails

Programme Arduino

void setup()
{
// ADC
analogReadResolution(12); // Ajustable <= 12 (4096 Niveaux)

// Affichage
Serial.begin(250000);
}

void loop()
{
// Lecture
float V1=(float)analogRead(A0);
V1=(V1*3.3/4095.0)*1000.0;
float V2=3000.0*(V1<1000.0);

// Affichage
Serial.print(V1); Serial.print("\t");
Serial.println(V2);
delay(25);
}
Click to rate this post!
[Total: 1 Average: 5]

Laisser un commentaire

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *

Retour en haut

You have successfully subscribed to the newsletter

There was an error while trying to send your request. Please try again.

FPGA | Arduino | Matlab | Cours will use the information you provide on this form to be in touch with you and to provide updates and marketing.