Marc et Jean-Yves ont réaliser des modélisations de phares :
Le four, le Stiff, le Créach, la Jument et Kermorvan sont réalisés.
Ces modélisations 3D doivent clignoter selon leur signature lumineuse,
par ex le Four possède 5 éclats toutes les 15s.
Ainsi, conformément à notre devise, CONCEVOIR – MODÉLISER – FABRIQUER
voici les différentes étapes de ce projet en images :
//Programme clignotements led en fonction de la valeur analogique
//d'un pont diviseur. © Fablab Iroise
#include "tinysnore.h" // Include TinySnore Library
#define pinLed 0
#define RPin A1
int RValue = 0;
void setup() {
// put your setup code here, to run once:
pinMode(pinLed, OUTPUT);
RValue = analogRead(RPin);
}
void loop() {
if (RValue < 100) { // Four 5 eclats /15s
digitalWrite(pinLed, HIGH); // turn the LED on (HIGH is the voltage level)
snore(250); // wait for a half second
digitalWrite(pinLed, LOW); // turn the LED off by making the voltage LOW
snore(1000);//delay(2000);
digitalWrite(pinLed, HIGH); // turn the LED on (HIGH is the voltage level)
snore(250); // wait for a half second
digitalWrite(pinLed, LOW); // turn the LED off by making the voltage LOW
snore(1000);//delay(2000);
digitalWrite(pinLed, HIGH); // turn the LED on (HIGH is the voltage level)
snore(250); // wait for a half second
digitalWrite(pinLed, LOW); // turn the LED off by making the voltage LOW
snore(1000);//delay(2000);
digitalWrite(pinLed, HIGH); // turn the LED on (HIGH is the voltage level)
snore(250); // wait for a half second
digitalWrite(pinLed, LOW); // turn the LED off by making the voltage LOW
snore(1000);//delay(2000);
digitalWrite(pinLed, HIGH); // turn the LED on (HIGH is the voltage level)
snore(250); // wait for a half second
digitalWrite(pinLed, LOW); // turn the LED off by making the voltage LOW
snore(10000);//delay(2000);
}
if (RValue > 100 && RValue < 200) { // St-Mathieu 1 eclats /15s
digitalWrite(pinLed, HIGH); // turn the LED on (HIGH is the voltage level)
snore(250); // wait for a half second
digitalWrite(pinLed, LOW); // turn the LED off by making the voltage LOW
snore(14500);//delay(2000);
}
if (RValue > 200 && RValue < 300) { // Ile Vierge/Kermorvan 1 eclats /5s Pierres noire idem Rouge
digitalWrite(pinLed, HIGH); // turn the LED on (HIGH is the voltage level)
snore(250); // wait for a half second
digitalWrite(pinLed, LOW); // turn the LED off by making the voltage LOW
snore(4500);//delay(2000);
}
if (RValue > 300 && RValue < 400) { // Le Créach 2 eclats /10s Pierres noire idem Rouge
digitalWrite(pinLed, HIGH); // turn the LED on (HIGH is the voltage level)
snore(250); // wait for a half second
digitalWrite(pinLed, LOW); // turn the LED off by making the voltage LOW
snore(1000);//delay(2000);
digitalWrite(pinLed, HIGH); // turn the LED on (HIGH is the voltage level)
snore(250); // wait for a half second
digitalWrite(pinLed, LOW); // turn the LED off by making the voltage LOW
snore(8500);//delay(2000);
}
if (RValue > 500 && RValue < 600) { // Le Stiff 2 eclats /20s Rouge
digitalWrite(pinLed, HIGH); // turn the LED on (HIGH is the voltage level)
snore(250); // wait for a half second
digitalWrite(pinLed, LOW); // turn the LED off by making the voltage LOW
snore(1000);//delay(2000);
digitalWrite(pinLed, HIGH); // turn the LED on (HIGH is the voltage level)
snore(250); // wait for a half second
digitalWrite(pinLed, LOW); // turn the LED off by making the voltage LOW
snore(18500);//delay(2000);
}
if (RValue > 700 && RValue < 800) { // Nividic 9 scintillements /10s Blanc
digitalWrite(pinLed, HIGH); // turn the LED on (HIGH is the voltage level)
snore(250); // wait for a half second
digitalWrite(pinLed, LOW); // turn the LED off by making the voltage LOW
snore(250);//delay(2000);
digitalWrite(pinLed, HIGH); // turn the LED on (HIGH is the voltage level)
snore(250); // wait for a half second
digitalWrite(pinLed, LOW); // turn the LED off by making the voltage LOW
snore(250);//delay(2000);
digitalWrite(pinLed, HIGH); // turn the LED on (HIGH is the voltage level)
snore(250); // wait for a half second
digitalWrite(pinLed, LOW); // turn the LED off by making the voltage LOW
snore(250);//delay(2000);
digitalWrite(pinLed, HIGH); // turn the LED on (HIGH is the voltage level)
snore(250); // wait for a half second
digitalWrite(pinLed, LOW); // turn the LED off by making the voltage LOW
snore(250);//delay(2000);
digitalWrite(pinLed, HIGH); // turn the LED on (HIGH is the voltage level)
snore(250); // wait for a half second
digitalWrite(pinLed, LOW); // turn the LED off by making the voltage LOW
snore(250);//delay(2000);
digitalWrite(pinLed, HIGH); // turn the LED on (HIGH is the voltage level)
snore(250); // wait for a half second
digitalWrite(pinLed, LOW); // turn the LED off by making the voltage LOW
snore(250);//delay(2000);
digitalWrite(pinLed, HIGH); // turn the LED on (HIGH is the voltage level)
snore(250); // wait for a half second
digitalWrite(pinLed, LOW); // turn the LED off by making the voltage LOW
snore(250);//delay(2000);
digitalWrite(pinLed, HIGH); // turn the LED on (HIGH is the voltage level)
snore(250); // wait for a half second
digitalWrite(pinLed, LOW); // turn the LED off by making the voltage LOW
snore(250);//delay(2000);
digitalWrite(pinLed, HIGH); // turn the LED on (HIGH is the voltage level)
snore(250); // wait for a half second
digitalWrite(pinLed, LOW); // turn the LED off by making the voltage LOW
snore(5000);//delay(2000);
}
if (RValue > 800 && RValue < 900) { // La Jument 3 eclats /15s Blanc
digitalWrite(pinLed, HIGH); // turn the LED on (HIGH is the voltage level)
snore(250); // wait for a half second
digitalWrite(pinLed, LOW); // turn the LED off by making the voltage LOW
snore(1000);//delay(2000);
digitalWrite(pinLed, HIGH); // turn the LED on (HIGH is the voltage level)
snore(250); // wait for a half second
digitalWrite(pinLed, LOW); // turn the LED off by making the voltage LOW
snore(1000);//delay(2000);
digitalWrite(pinLed, HIGH); // turn the LED on (HIGH is the voltage level)
snore(250); // wait for a half second
digitalWrite(pinLed, LOW); // turn the LED off by making the voltage LOW
snore(12
500);//delay(2000);
}
}