Making some arduino-shaped messes

This commit is contained in:
Dan Buch 2023-01-07 18:44:31 -05:00
parent 6c0083e094
commit 41f53c34c0
Signed by: meatballhat
GPG Key ID: A12F782281063434
4 changed files with 37 additions and 0 deletions

1
.gitignore vendored
View File

@ -6,3 +6,4 @@
**/target/
/hello_world/main
/aoc*/**/input
/arduino/build-*/

2
arduino/.envrc Normal file
View File

@ -0,0 +1,2 @@
export ARDMK_DIR=/usr/share/arduino
export ARDMK_VENDOR=archlinux-arduino

3
arduino/Makefile Normal file
View File

@ -0,0 +1,3 @@
BOARD_TAG = uno
include $(ARDMK_DIR)/Arduino.mk

31
arduino/sos.ino Normal file
View File

@ -0,0 +1,31 @@
#define DIT_DURATION_MS 88
#define LETTER_PAUSE_MS 1000
void setup() {
pinMode(13, OUTPUT);
}
void dit() {
digitalWrite(13, HIGH);
delay(DIT_DURATION_MS);
digitalWrite(13, LOW);
delay(DIT_DURATION_MS);
}
void dah() {
digitalWrite(13, HIGH);
delay(DIT_DURATION_MS * 3);
digitalWrite(13, LOW);
delay(DIT_DURATION_MS);
}
void loop() {
dit(); dit(); dit();
delay(LETTER_PAUSE_MS);
dah();
delay(LETTER_PAUSE_MS);
dit(); dit(); dit();
delay(LETTER_PAUSE_MS);
}