Stap 2: Code
Laat begin codering./* SOS signal Created by Vaidotas on 4/16/2012. Copyright (c) 2012
*/int pin = 8; int pause = 100; int note = 440; // music note A4voidsetup() { // no need } // SOS signalvoidloop() { threeDots(); threeDashes(); threeDots(); delay(3000); } // three short signalsvoid threeDots() { for (int i=0; i<3; i++){ tone(pin, note, 100); delay(200); noTone(pin); } delay(200); } // three long signals8void threeDashes() { for (int i=0; i<3; i++){ tone(pin, note, 300); delay(400); noTone(pin); } delay(200); }
Uploaden en genieten ;)