Carte Arduino :
• Microcontroller ATmega328
• Operating Voltage 5V
• Input Voltage (recommended) 7-12V
• Input Voltage (limits) 6-20V
• Digital I/O Pins 14 (of which 6 provide PWM output) : 0V or 5V
• Analog Input Pins 6
• DC Current per I/O Pin 40 mA
• Flash Memory 32 KB (ATmega328) of which 0.5 KB used by bootloader
• SRAM 2 KB (ATmega328)
• EEPROM 1 KB (ATmega328)
• Clock Speed 16 MHz
millis() (Functions > Time > Millis)
Description : Returns the number of milliseconds passed since the Arduino board began running the current program. This number will overflow (go back to zero), after approximately 50 days.
Syntax : time = millis()
Parameters : None
Returns : Number of milliseconds passed since the program started.
Data type: unsigned long.
Example Code : this example code prints on the serial port the number of milliseconds passed since the Arduino board started running the code itself.
unsigned long myTime;
void setup() {
Serial.begin(9600);
}
void loop() {
Serial.print("Time: ");
myTime = millis();
Serial.println(myTime); // prints time since program started
delay(1000); // wait a second so as not to send massive amounts of data
}
Composant 4N35 :
Functioning : an opto-isolator (also called an optocoupler, photocoupler, or optical isolator) is an electronic component that transfers electrical signals between two isolated circuits by using light. Opto-isolators prevent high voltages from affecting the system receiving the signal. Thus an optocoupler is formed by an infrared LED and a phototransistor or a photodiode. The optocoupler provides a link between the LED and the phototransistor while providing electrical isolation between the two.