Arduino K-7

K-7 students (1st ESO) will present a project including LED starting with SOS lights code in Tinkercad (previously circuits.io) using a screencast recording (screentogif) to show the name of the author in a wordpress or neocities blog. Remember the Arduino cheatsheet For beginners I recommend Getting started with Arduino book by Maximo Bazi (Arduino co-Foundation)  and Programming Arduino. Getting started with skecthes by Simon Monk. The minimum project is SOS + Student name in Morse code using lights and or sound. High scores if Arduino musical notes depends on the light level (LDR) or other ideas mixing light, LDR sensor and musical notes. ArduinoTemperature Students must insert a gif in their wordpress blogs and it must be shown the simulation of the circuit their names, the circuit and the code. The circuit can be also added as a regular image file (e.g. fritzing software) and the code as text. SOS code
const byte ledPin = 13;
void setup() {
// Use ledPin as output.
pinMode(ledPin, OUTPUT);
}
void shortBlink() {
// Make a single short blink
digitalWrite(ledPin, HIGH);
delay(200);
digitalWrite(ledPin, LOW);
delay(200);
}
void longBlink() {
// Make a single long blink
digitalWrite(ledPin, HIGH);
delay(600);
digitalWrite(ledPin, LOW);
delay(200);
}
void morseBlink(char character) {
// Translate character to Morse code
switch(character){
case s:
shortBlink();
shortBlink();
shortBlink();
break;
case o:
longBlink();
longBlink();
longBlink();
break;
}
}
void loop() {
// Start blinking SOS
morseBlink(s);
morseBlink(o);
morseBlink(s);
}
According to the wikipedia article on Morse Code: A ‘dash’ should be three times the length of a ‘dot’. The time between dots or dashes in a letter should be that same as the time for a dot. The time between letters should be three dot times. int ledPin = 13; const int DOT = 150; const int DASH = DOT * 3; int durations[] = {DOT, DOT, DOT, DASH, DASH, DASH, DOT, DOT, DOT}; void setup() { pinMode(ledPin, OUTPUT); } void loop() { for (int i = 0; i < 9; i++) { flash(durations[i]); if (i == 2 || i == 5) delay(DASH – DOT); // inter-letter additional time } delay(1000); } void flash(int duration) { digitalWrite(ledPin, HIGH); delay(duration); digitalWrite(ledPin, LOW); delay(DOT); } //Another SOS version int dotDur = 125; int dashDur = dotDur * 3; int wordPause = dotDur * 7; void setup() { // initialize the digital pin as an output. // Pin 13 has an LED connected on most Arduino boards: pinMode(13, OUTPUT); } void loop() { dot(dotDur); dot(dotDur); dot(dashDur); dash(dotDur); dash(dotDur); dash(dashDur); dot(dotDur); dot(dotDur); dot(wordPause); } void dash(int pauseDur) { digitalWrite(13, HIGH); // set the LED on delay(dashDur); digitalWrite(13, LOW); // set the LED off delay(pauseDur); } void dot(int pauseDur) { digitalWrite(13, HIGH); // set the LED on delay(dotDur); // wait for a second digitalWrite(13, LOW); // set the LED off delay(pauseDur); } http://www.qsl.net/eb8bev/MORSE.GIF

The best way to predict the future is to invent it (Alan Kay)