This circuit was simple and I had no issues building it. Instead of using the blink example code, I used the morse code program that I wrote for assignment 0. The morse code program makes the LED blink my name (Adam) in morse code. The program looks like this:
# define LED_PIN 13 // Pin number attached to LED.
void setup() {
// put your setup code here, to run once:
pinMode(LED_PIN, OUTPUT); // Configure pin 13 to be a digital output.
}
void loop() {
// put your main code here, to run repeatedly:
letterA();
longSpace();
letterD();
longSpace();
letterA();
longSpace();
letterM();
longerSpace();
}
void letterA(){
dit();
space();
dah();
}
void letterD(){
dah();
space();
dit();
space();
dit();
}
void letterM(){
dah();
space();
dah();
}
void dit(){
digitalWrite(LED_PIN, HIGH); // Turn on the LED.
delay(100); // Wait 0.1 seconds (100 milliseconds).
}
void dah(){
digitalWrite(LED_PIN, HIGH); // Turn on the LED.
delay(300); // Wait 0.3 seconds (300 milliseconds).
}
void space(){
digitalWrite(LED_PIN, LOW); // Turn off the LED.
delay(100); // Wait 0.1 seconds.
}
void longSpace(){
digitalWrite(LED_PIN, LOW); // Turn off the LED.
delay(300); // Wait 0.3 seconds.
}
void longerSpace(){
digitalWrite(LED_PIN, LOW); // Turn off the LED.
delay(700); // Wait 0.7 seconds.
}
Here is a video of the program in action on Circuit 1A:
The Landing is a social site for Athabasca University staff, students and invited guests. It is a space where they can share, communicate and connect with anyone or everyone.
Unless you are logged in, you will only be able to see the fraction of posts on the site that have been made public. Right now you are not logged in.
If you have an Athabasca University login ID, use your standard username and password to access this site.
We welcome comments on public posts from members of the public. Please note, however, that all comments made on public posts must be moderated by their owners before they become visible on the site. The owner of the post (and no one else) has to do that.
If you want the full range of features and you have a login ID, log in using the links at the top of the page or at https://landing.athabascau.ca/login (logins are secure and encrypted)
Posts made here are the responsibility of their owners and may not reflect the views of Athabasca University.