Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ####################################################################################################################################################################################
- // CLAUDE DUFOURMONT Test_TensionPB3
- // °°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°° claude.dufourmont@laposte.net °°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°
- // ####################################################################################################################################################################################
- // Créé le 08/06/20
- // Pour ATtiny85 - Test surveillance tension avec tension sur PB3
- // Ce programme n'a pas de boucle loop , C'EST VOULU
- // J'allume bien ou éteins la LedRouge selon que la tension envoyée est inférieur ou supérieure à SeilTension
- // #####################################################################################################################################################################################
- #define LedRouge 1
- boolean etatBATBAS;
- int Tension;
- int SeuilTension = 511;
- void setup()
- {
- Tension = analogRead (3); // 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