/* 21/10/2021 * joinSketchv1_blink * * This is the basic blink example * All I have added is the serial output * * As usual I list any pins used in the sketch, this prevents duplicates * pins used: * * 13 built in LED */ //LED_BUILTIN not used because it does not work on some boards such as the ESP32 //So stops bad habits developing const int ledPin = 13; //set the LED pin void setup() { //Serial started for debugging Serial.begin(9600); //print skecth name so we know the sketch has uploaded. Serial.print("joinSketchv1_blink"); //set the pin mode for the LED pin pinMode(ledPin,OUTPUT); } void loop() { /* //The standard blink sketch switches the led on and off after a 1 second delay digitalWrite(ledPin, HIGH); // turn the LED on (HIGH is the voltage level) delay(1000); // wait for a second digitalWrite(ledPin, LOW); // turn the LED off by making the voltage LOW delay(1000); */ //to make out code a bit more interesting the sequence has been lengthened to create an SOS //with all the delays this lengthens the sequence to about 7+ seconds //This will help us see the issue when joining sketches together //three dots..quick pulses digitalWrite(ledPin, HIGH); delay(200); digitalWrite(ledPin, LOW); delay(200); digitalWrite(ledPin, HIGH); delay(200); digitalWrite(ledPin, LOW); delay(200); digitalWrite(ledPin, HIGH); delay(200); digitalWrite(ledPin, LOW); delay(600); //Three dashes digitalWrite(ledPin, HIGH); delay(600); digitalWrite(ledPin, LOW); delay(200); digitalWrite(ledPin, HIGH); delay(600); digitalWrite(ledPin, LOW); delay(200); digitalWrite(ledPin, HIGH); delay(600); digitalWrite(ledPin, LOW); delay(600); //three dots..quick pulses digitalWrite(ledPin, HIGH); delay(200); digitalWrite(ledPin, LOW); delay(200); digitalWrite(ledPin, HIGH); delay(200); digitalWrite(ledPin, LOW); delay(200); digitalWrite(ledPin, HIGH); delay(200); digitalWrite(ledPin, LOW); delay(2000); //wait 2 seconds before doing it all again }