Ci-dessous, les différences entre deux révisions de la page.
projets:insoleuse_cyanotype:accueil [2022/02/08 04:53] resonance Créé depuis le formulaire projets:creer |
projets:insoleuse_cyanotype:accueil [2022/02/08 04:55] (Version actuelle) resonance [Tutoriel] |
||
---|---|---|---|
Ligne 18: | Ligne 18: | ||
===== Tutoriel ===== | ===== Tutoriel ===== | ||
- | Guide pas à pas pour la réalisation | + | * fixer led 370nm sur couvercle valise |
+ | * faire un montage arduino + relay + potentiometre + button push + (interrupteur principal qui coupe la source | ||
+ | |||
+ | |||
+ | <code c+> | ||
+ | int buttonState = 0; | ||
+ | long minuteur = 0; | ||
+ | |||
+ | void setup() | ||
+ | { | ||
+ | pinMode(2, INPUT); | ||
+ | pinMode(LED_BUILTIN, | ||
+ | Serial.begin(9600); | ||
+ | } | ||
+ | |||
+ | void loop() | ||
+ | { | ||
+ | // read the state of the pushbutton value | ||
+ | buttonState = digitalRead(2); | ||
+ | minuteur = analogRead(A0); | ||
+ | |||
+ | // 1minute : | ||
+ | | ||
+ | | ||
+ | | ||
+ | Serial.println(minuteur); | ||
+ | | ||
+ | if (buttonState == HIGH) { | ||
+ | // turn LED/relay on | ||
+ | digitalWrite(LED_BUILTIN, | ||
+ | Serial.println(minuteur*1000); | ||
+ | delay (minuteur*1000); | ||
+ | digitalWrite(LED_BUILTIN, | ||
+ | } | ||
+ | |||
+ | delay(100); // Delay a little bit to improve simulation performance | ||
+ | } | ||
+ | |||
+ | </ | ||
===== Photos ===== | ===== Photos ===== | ||
Code pour afficher les images du projet : | Code pour afficher les images du projet : |