Mechatronics LAB
Published © LGPL

Repeating Statements with a Counter Arduino and MicroPython

In this section, we explore the for loop, a fundamental construct in programming for repeating statements a specified number of times. The f

BeginnerFull instructions provided1 hour17
Repeating Statements with a Counter Arduino and MicroPython

Things used in this project

Hardware components

ESP32 Board
×1
Breadboard (optional, for easier connections)
×1
Jumper Wires
×1

Story

Read more

Code

Arduino code

Arduino
void setup() {
 Serial.begin(9600);
}

void loop(){
 Serial.println("for(int i=0; i < 4; i++)");
 for(int i=0; i < 4; i++)
 {
   Serial.println(i);
 }
 delay(1000);
}

Micropython Code

Python
import time

for i in range(4):
   print(i)
   time.sleep(1)

Credits

Mechatronics LAB
75 projects • 47 followers
I am Sarful , I am a Mechatronics Engineer & also a teacher I am Interested in the evolution of technology in the automation industry .
Contact

Comments

Please log in or sign up to comment.