Posts

Arduino Traffic Light LED on Breadboard

Image
  Objective: Set up a traffic light LED automated system. Arrange the resisters in series. Code: void setup() {   // put your setup code here, to run once:   // GREEN PIN   pinMode(10, OUTPUT);   // YELLOW PIN   pinMode(7, OUTPUT);   // RED PIN   pinMode(3, OUTPUT); } void loop() {   // put your main code here, to run repeatedly:   // GREEN LED   digitalWrite(10, HIGH);   delay(10000);   digitalWrite(10, LOW);   delay(1000);   // YELLOW LED   digitalWrite(7, HIGH);   delay(1000);   digitalWrite(7, LOW);   delay(1000);   // RED LED   digitalWrite(3, HIGH);   delay(10000);   digitalWrite(3, LOW);   delay(1000); } Video: The presentation video is in the link below. LED Traffic Light - YouTube

Arduino LED

Image
Objective: Code the Arduino LED on pin 13 to generate a constant and alternating output. Alterations: Delete the two lines of delay(1000); code to produce a constant LED output. Code: void setup() {   // put your setup code here, to run once:   // Set pin 13 (LED) as the output.   pinMode(13, OUTPUT); } void loop() {   // put your main code here, to run repeatedly:   // Send signal to pin 13 to turn it on.    // Set it as HIGH means 5V or LOW to turn it off.   // Delay for 1000 ms (1 second)   // Turn the light for 1 ms and turn off for 1 ms in a loop.    // (Blinking LED)   digitalWrite(13, HIGH);   delay(1000);   digitalWrite(13, LOW);   delay(1000); } Video: The presentation video link is below. Arduino LED - YouTube

Install WSL & Code C in VS Code on Windows 10/11

Image
Photo by Fotis Fotopoulos on Unsplash Summary: Enable Windows Subsystems for Linux (WSL) for Windows 10/11 on PC. Install the WSL extension on VS Code. Connect to WSL on VS Code. Access the Linux directory on File Explorer. Run C code on Microsoft Visual Code Studio (VS Code) through WSL. Install WSL: Search Command Prompt (cmd) and open it. Once the Command Prompt opens, enter the following code into the terminal. wsl --install WSL will install in a few seconds as noted in cmd . Ubuntu: Once WSL is installed, search Ubuntu and open it. You will be prompted to create a username and password for Ubuntu on the terminal. (The password will be invisible on the terminal). Once you have created your credentials, enter each of the codes into the Ubuntu terminal. sudo apt update sudo apt install build-essential Verify the version using the code below to see if it is installed. gcc --version Linux Folder in File Explorer: Open File Explorer and go to the following directory below. Linux>Ub