From 42ec7df723ece5c2c4400d8db24e3a2ac6b826d0 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Wed, 25 Apr 2018 09:03:31 +0200 Subject: wip --- arduino/01-blink-a-led/Makefile | 4 +++ arduino/01-blink-a-led/blink-a-led.md | 39 +++++++++++++++++++++ arduino/01-blink-a-led/blink-a-led.pdf | Bin 0 -> 703496 bytes arduino/01-blink-a-led/schematic/assignment-1.fzz | Bin 0 -> 21480 bytes .../01-blink-a-led/schematic/assignment-1_bb.pdf | Bin 0 -> 354599 bytes .../schematic/assignment-1_schem.pdf | Bin 0 -> 263607 bytes .../solution/assignment-1/assignment-1.ino | 20 +++++++++++ 7 files changed, 63 insertions(+) create mode 100644 arduino/01-blink-a-led/Makefile create mode 100644 arduino/01-blink-a-led/blink-a-led.md create mode 100644 arduino/01-blink-a-led/blink-a-led.pdf create mode 100644 arduino/01-blink-a-led/schematic/assignment-1.fzz create mode 100644 arduino/01-blink-a-led/schematic/assignment-1_bb.pdf create mode 100644 arduino/01-blink-a-led/schematic/assignment-1_schem.pdf create mode 100644 arduino/01-blink-a-led/solution/assignment-1/assignment-1.ino (limited to 'arduino/01-blink-a-led') diff --git a/arduino/01-blink-a-led/Makefile b/arduino/01-blink-a-led/Makefile new file mode 100644 index 0000000..b015ec1 --- /dev/null +++ b/arduino/01-blink-a-led/Makefile @@ -0,0 +1,4 @@ +DIR=01-blink-a-led +A=blink-a-led + +include $(BASEDIR)/Makefile.assignment diff --git a/arduino/01-blink-a-led/blink-a-led.md b/arduino/01-blink-a-led/blink-a-led.md new file mode 100644 index 0000000..f4b3fa1 --- /dev/null +++ b/arduino/01-blink-a-led/blink-a-led.md @@ -0,0 +1,39 @@ +# Assignment: Blink a led + + +## Goal + +Check that your local environment is working properly. + +## Step 1 + +Create this schematic: + +![](schematic/assignment-1_schem.pdf) + +![](schematic/assignment-1_bb.pdf) + +The colors on the wires used does not matter. The resistors +orientation is not important, but the LED's orientation is important. + +## Step 2 + +Implement `setup()` and `loop()`. In `setup()` configure the LED pin and blink the LED in `loop()`. + +Use these functions: + +~~~ .c++ + +Serial.begin(115200); +Serial.println(string); + +pinMode(pin, mode); +digitalWrite(pin, state); // HIGH or LOW +delay(); + +~~~ + +## Tips + +* It is useful to print a startup message just to see when the + application has started. diff --git a/arduino/01-blink-a-led/blink-a-led.pdf b/arduino/01-blink-a-led/blink-a-led.pdf new file mode 100644 index 0000000..de719fd Binary files /dev/null and b/arduino/01-blink-a-led/blink-a-led.pdf differ diff --git a/arduino/01-blink-a-led/schematic/assignment-1.fzz b/arduino/01-blink-a-led/schematic/assignment-1.fzz new file mode 100644 index 0000000..da3ad5b Binary files /dev/null and b/arduino/01-blink-a-led/schematic/assignment-1.fzz differ diff --git a/arduino/01-blink-a-led/schematic/assignment-1_bb.pdf b/arduino/01-blink-a-led/schematic/assignment-1_bb.pdf new file mode 100644 index 0000000..0995ece Binary files /dev/null and b/arduino/01-blink-a-led/schematic/assignment-1_bb.pdf differ diff --git a/arduino/01-blink-a-led/schematic/assignment-1_schem.pdf b/arduino/01-blink-a-led/schematic/assignment-1_schem.pdf new file mode 100644 index 0000000..a5241b2 Binary files /dev/null and b/arduino/01-blink-a-led/schematic/assignment-1_schem.pdf differ diff --git a/arduino/01-blink-a-led/solution/assignment-1/assignment-1.ino b/arduino/01-blink-a-led/solution/assignment-1/assignment-1.ino new file mode 100644 index 0000000..5b72892 --- /dev/null +++ b/arduino/01-blink-a-led/solution/assignment-1/assignment-1.ino @@ -0,0 +1,20 @@ +const int LED_PIN = D0; + +void setup() { + Serial.begin(115200); + Serial.println(); + Serial.println(); + Serial.println("Hello world!"); + pinMode(LED_PIN, OUTPUT); +} + +void loop() { + digitalWrite(LED_PIN, HIGH); + Serial.println("HIGH"); + delay(1000); + + digitalWrite(LED_PIN, LOW); + Serial.println("LOW"); + delay(1000); +} + -- cgit v1.2.3