Wendy did a lecture on electronics and arduino which I found super helpful as I am a novice with coding and electronics. We learnt the the difference between a microcontroller and a microprocessor (for this project we are using a Microcontroller) as well as the difference between input and output. How I understand it is that input is something that senses or measures something (temperature, humidity, light, touch, RTC) and it sends information to the electronic brain of the arduino which processes that information and results in an output (LED blink etc, buzzer/alarm, open a door, run water).
With Arduino we learnt that there are 3 different aspects of it: 1) Global Variables, 2) Setup, 3) Loop. The global variables is where you declare variables such as time, the setup is where you define the pins and the loop is where things run consistently after the setup.
We did some trialling and testing to get comfortable with the arduino setup and how coding works, the first one we did was blink test, the code for it and videos follow. I found this test quite easy as we were able to copy and paste it from seeeduino and play around with the time between blinks etc.

// Project One - Double Blink
//
int del=500; // adjust for blink rate
void setup()
{
pinMode(2, OUTPUT);
}
void loop()
{
digitalWrite(2, HIGH);
delay(del);
digitalWrite(2, LOW);
delay(del);
}
https://drive.google.com/file/d/16E97Xcvz1eng-qrNBittjEqmmNg3oyJV/view?usp=sharing
The second test I did was trying to make the LED fade and blink and the same time I found this more interesting as we were able to hack the code and play around with the timing more to make the two different codes work cohesively. The original blink code is posted above the the original fade code is posted below, however I unfortunately did not save the fade/blink code that I hacked together. The video is below.

/*
Fade
This example shows how to fade an LED on pin 3 using the analogWrite()
function.
The analogWrite() function uses PWM, so if you want to change the pin you're
using, be sure to use another PWM capable pin. On most Arduino, the PWM pins
are identified with a "~" sign, like ~3, ~5, ~6, ~9, ~10 and ~11.
This example code is in the public domain.
http://www.arduino.cc/en/Tutorial/Fade
*/
int led = 3; // the PWM pin the LED is attached to
int brightness = 0; // how bright the LED is
int fadeAmount = 5; // how many points to fade the LED by
// the setup routine runs once when you press reset:
void setup() {
// declare pin 3 to be an output:
pinMode(led, OUTPUT);
}
// the loop routine runs over and over again forever:
void loop() {
// set the brightness of pin 3:
analogWrite(led, brightness);
// change the brightness for next time through the loop:
brightness = brightness + fadeAmount;
// reverse the direction of the fading at the ends of the fade:
if (brightness <= 0 || brightness >= 255) {
fadeAmount = -fadeAmount;
}
// wait for 30 milliseconds to see the dimming effect
delay(50);
}
https://drive.google.com/file/d/1OHT1MamHc8hHoHY-3jBrupGIfPvbccj8/view?usp=sharing
The next test I did was the buzzer and LED test, it was super interesting being able to hack together two pieces of code to get two outputs working at the same time.

// Double Blink abd buzzer mesh
//
int del=150; // adjust for blink rate
void setup()
{
pinMode(3, OUTPUT);
pinMode(6, OUTPUT);
}
void loop()
{
digitalWrite(3, HIGH);
delay(1000);
digitalWrite(3, LOW);
delay(1000);
digitalWrite(6, HIGH);
delay((100));
digitalWrite(6, LOW);
delay((100));
}
https://drive.google.com/file/d/1KbCARIdZ-rfUZWN0rTp-HvArCcD3Twbf/view?usp=sharing
I next wanted to see if I could control the buzzer and LED output with an input button. This worked quite successfully and was pretty easy considering the board was starting to look a bit hectic to a novice like myself.

/*
Button
Turns on and off a light emitting diode(LED) connected to digital pin 13,
when pressing a pushbutton attached to pin 2.
The circuit:
- LED attached from pin 13 to ground
- pushbutton attached to pin 2 from +5V
- 10K resistor attached to pin 2 from ground
- Note: on most Arduinos there is already an LED on the board
attached to pin 13.
created 2005
by DojoDave <http://www.0j0.org>
modified 30 Aug 2011
by Tom Igoe
This example code is in the public domain.
http://www.arduino.cc/en/Tutorial/Button
*/
// constants won't change. They're used here to set pin numbers:
const int buttonPin = 2; // the number of the pushbutton pin
const int ledPin = 3; // the number of the LED pin
const int buzzer = 6; // the number of the buzzer pin
// variables will change:
int buttonState = 0; // variable for reading the pushbutton status
void setup() {
// initialize the LED pin as an output:
pinMode(ledPin, OUTPUT);
// initialize the pushbutton pin as an input:
pinMode(buttonPin, INPUT);
}
void loop() {
// read the state of the pushbutton value:
buttonState = digitalRead(buttonPin);
// check if the pushbutton is pressed. If it is, the buttonState is HIGH:
if (buttonState == HIGH) {
// turn LED on:
digitalWrite(ledPin, HIGH);
digitalWrite(buzzer, HIGH);
} else {
// turn LED off:
digitalWrite(ledPin, LOW);
digitalWrite(buzzer, LOW);
}
}
https://drive.google.com/file/d/1GpazEO16l-khicq6bTsZQTPC_ev6Xw3t/view?usp=sharing