Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ####################################################################################################################################################################################
- // CLAUDE DUFOURMONT Test_TensionPB2
- // °°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°° claude.dufourmont@laposte.net °°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°
- // ####################################################################################################################################################################################
- // Créé le 08/06/20
- // Pour ATtiny85 - Test surveillance tension avec tension sur PB2
- // Ce programme n'a pas de boucle loop , C'EST VOULU
- // La LedRouge s'allume ou s'eteint de manière aléatoire comme si PB2 était "en l'air"
- // L'essai a été fait avec 2 ATtiny85 différents et avec le même mauvais résultat
- // #####################################################################################################################################################################################
- #define LedRouge 1
- boolean etatBATBAS;
- int Tension;
- int SeuilTension = 511;
- void setup()
- {
- Tension = analogRead (2); // Lecture en 0 - 1023 points de l'image de la tension
- pinMode (LedRouge, OUTPUT);
- delay(100);
- analogRead (Tension);
- if (Tension < SeuilTension)
- {
- etatBATBAS = LOW; // VOLONTAIREMENT ETAT LOW POUR CE CAS
- }
- else
- {
- etatBATBAS = HIGH;
- }
- if (etatBATBAS == LOW)
- {
- digitalWrite (LedRouge, HIGH);
- }
- if (etatBATBAS == HIGH)
- {
- digitalWrite (LedRouge, LOW);
- }
- } // Accolade de fermeture void setup
- void loop () {}
- //***************************************************************************************************************************************************************************************
- // VOLONTAIREMENT PAS DE BOUCLE
- //***************************************************************************************************************************************************************************************
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement