Description
I used an Arduino with a green light. I rewrote my code to spell out my name, J-A-K-E in morse code, then to pause for a couple seconds, then repeat.
I wrote individual functions for a “dot” and for a “dash,” then used those functions to construct a function for each of the four letters that I needed.
When I tested it out, it appeared to work well, although I’m not a fluent morse-code-ist, so I cannot say for sure. Today’s class was so hecking cool! I could make blinky patterns all night.
Components
- 1 Arduino
- 1 LED
- 1 Resistor (220Ω)
- 1 Breadboard
Code
[[code]]czoxODgzOlwiLyoNCiAqIExhYiAxOiBMRUQgQmxpbmtlcg0KICogSmFrZSBQZXR0ZXJzb24NCiAqIFByb2YuIFJ5b2thaSAtLSBJbmZ7WyYqJl19byAyNjINCiAqIFdlZG5lc2RheSwgQXVndXN0IDMxDQogKiANCiAqIFRoZSBmb2xsb3dpbmcgcHJvZ3JhbSB1c2VzIGFuIEFyZHVpbntbJiomXX1vLCBhIExFRCwgYW5kIGEgMjIwIE9obQ0KICogcmVzaXN0b3IgaW4gc2VyaWVzLCBhbmQgc3BlbGxzIG91dCBteSBuYW1lLCBcIkotQXtbJiomXX0tSy1FXCIgaW4NCiAqIG1vcnNlIGNvZGUuDQogKi8NCg0KLy8gdGhlIHNldHVwIGZ1bmN0aW9uIHJ1bnMgb25jZSB3aGVuIHlvdSBwcntbJiomXX1lc3MgcmVzZXQgb3IgcG93ZXIgdGhlIGJvYXJkDQp2b2lkIHNldHVwKCkgew0KIC8vIGluaXRpYWxpemUgZGlnaXRhbCBwaW4gMTMge1smKiZdfWFzIGFuIG91dHB1dC4NCiBwaW5Nb2RlKDEzLCBPVVRQVVQpOw0KfQ0KDQovLyB0aGlzIGZ1bmN0aW9uIG91dHB1dHMgYSBkb3QsIGZ7WyYqJl19b2xsb3dlZCBieSBhIDAuMiBzZWNvbmQgcGF1c2UNCnZvaWQgZG90KCkgew0KIGRpZ2l0YWxXcml0ZSgxMywgSElHSCk7IC8vIHR1cntbJiomXX1uIHRoZSBMRUQgb24NCiBkZWxheSgyMDApOyAvLyBsZWF2ZSBpdCBvbiBmb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