Skip to content

4. Embedded programming

This week is about embedded programming where we will experment in deffirent kind of microo controller

Research

The program that we are using to send the cods to te micro controller is The Arduino Integrated Development Environment - or Arduino Software (IDE) - contains a text editor for writing code, a message area, a text console, a toolbar with buttons for common functions and a series of menus. It connects to the Arduino hardware to upload programs and communicate with them.

SET UP

First We open the program

then connect the micro controler

Code Example

Use the three backticks to separate code.

// 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(1000);                       // wait for a second
}

via GIPHY

then I change the value

and this was the resulte

via GIPHY

assignments

There was a 3 level assignment i chose the medium one , we need to make the LED light say a name in mores code and I chose my uncle name (ALI)

void setup() {
  // put your setup code here, to run once:
 pinMode(LED_BUILTIN, OUTPUT);
}

void loop() {
  // put your main code here, to run repeatedly:
  digitalWrite(LED_BUILTIN, HIGH);  
  delay(1000);                     
  digitalWrite(LED_BUILTIN, LOW);  
  delay(500); 
  digitalWrite(LED_BUILTIN, HIGH);  
  delay(2000);                     
  digitalWrite(LED_BUILTIN, LOW);  
  delay(3000);         
  digitalWrite(LED_BUILTIN, HIGH);  
  delay(1000);                     
  digitalWrite(LED_BUILTIN, LOW);  
  delay(500); 
  digitalWrite(LED_BUILTIN, HIGH);  
  delay(2000);                     
  digitalWrite(LED_BUILTIN, LOW);  
  delay(500);    
  digitalWrite(LED_BUILTIN, HIGH);  
  delay(1000);                     
  digitalWrite(LED_BUILTIN, LOW);  
  delay(500); 
  digitalWrite(LED_BUILTIN, HIGH);      
  digitalWrite(LED_BUILTIN, LOW);  
  delay(3000);        
  digitalWrite(LED_BUILTIN, HIGH);  
  delay(1000);                     
  digitalWrite(LED_BUILTIN, LOW);  
  delay(500); 
  digitalWrite(LED_BUILTIN, HIGH);  
  delay(1000);                     
  digitalWrite(LED_BUILTIN, LOW);  
  delay(3000);               
}

via GIPHY

after that they give us kids iot micro controler ESP32

then I work on programing a trafic light with a button so when every time I click on the button the color shift , and we tride a lot of ways to do that kind of code , 5 people tride to solve and come up with a code that will do that task but we could not at the end and this is the result

via GIPHY

Group Work


Last update: July 25, 2024