During this week, I learnt about microcontrollers boards and how to program them.
There are two assignments in this week:
A microcontroller is a compact integrated circuit designed to govern a specific operation in an embedded system. It typically includes a processor, memory, and input/output peripherals on a single chip. Microcontrollers are widely used in devices like appliances, automotive systems, and robotics for automation and control tasks.
In electronics, AC (Alternating Current) and DC (Direct Current) are two fundamental types of electrical current, each with distinct characteristics, the main differences between AC and DC are:
We got a many micro-controller boards, each group take one and start search about it to find a specific information. You will find the information here
I start work in arduino software v2.3.2, before doing anything, I do a change in the setting to show verbose output
I got a micro-controller board with type arduino Nano so I start link it with the laptop then search for it in the software. The micro-controller board's search bar is in the top of the page, when I open it I search for my board type.
Before that, to know the type of my micro-controller board (While it's not written on it) I go back to the table that we do it in day 1 and I find it as a Arduino Nano classic.
To test the linking between the software and the board, I open an example code from the software itself and upload it.
And it's work!
This code turn on and off the light in the board automatically each second.
I then change the time of turning on and off to 0.5 second.
The instructor then presents us with a three challenges. One of them is to program your microcontroller to transmit a one-word message in Morse code, and then challenge a friend, relative, coworker, or teacher to decipher it.
Referee to this schedule:
This is the Medium mode challenge and it was easy, just need a little thinking.
I do it for a word SOS:
// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(LED_BUILTIN, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(500); // wait for a second
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(500); // wait for a second
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(3000); // wait for a second
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(2000); // wait for a second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(500); // wait for a second
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(2000); // wait for a second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(500); // wait for a second
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(2000); // wait for a second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(3000); // wait for a second
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(500); // wait for a second
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(500); // wait for a second
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(5000);
}
int delayTime = 1000;
void setup() {
Serial.begin(9600);
pinMode(LED_BUILTIN, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
delayTime = Serial.parseInt();
Serial.print(delayTime);
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(delayTime);
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(delayTime);
}
int delayTime = 3000;
void setup() {
Serial.begin(9600);
pinMode(LED_BUILTIN, OUTPUT);
}
void loop() {
if (Serial.available() > 0) {
delayTime = Serial.parseInt();
Serial.println(delayTime);
digitalWrite(LED_BUILTIN, LOW);
delay(delayTime);
digitalWrite(LED_BUILTIN, HIGH);
delay(delayTime);
digitalWrite(LED_BUILTIN, LOW);
delay(delayTime);
digitalWrite(LED_BUILTIN, HIGH);
delay(delayTime);
}
digitalWrite(LED_BUILTIN, LOW);
}
This day I start work with another programming software which is "Thonny", I used micro-python language to work in.
With this software I used a micro-controller called "KidsIOT", It's a micro-controller with a box that keep connected wires much easier.
Always feel Free to Contact & Hire me