notesonly.in

One notebook for every subject — open it anywhere.

Log in

Microprocessors and microcontrollers basics (introductory)

Digital electronics · Physics

DC circuit

Interactive 3D

Electrons drift around the loop — raise the voltage and watch the current obey Ohm's law.

Controls

Drag the sliders or type a value — the simulation updates live.

V
1V12V

Study notes

Example: Blinking an LED with a microcontroller (Arduino Uno) Step 1: Connect the LED. Place the long leg (anode) of the LED into digital pin 13 and the short leg (cathode) to GND through a 220Ω resistor. Step 2: Write the program. ```cpp void setup() { pinMode(13, OUTPUT); // tell pin 13 to be an output } void loop() { digitalWrite(13, HIGH); // turn LED on delay(1000); // wait 1 second digitalWrite(13, LOW); // turn LED off delay(1000); // wait 1 second } ``` Step 3: Upload the code to the Arduino using the IDE. Step 4: The microcontroller runs the program: it sets pin 13 high, waits 1 second, sets it low, waits again, and repeats forever, making the LED blink. Key points: - The microcontroller contains CPU, flash memory (stores the program), and I/O pins. - `pinMode` configures the pin. - `digitalWrite` sends a 1 (HIGH) or 0 (LOW) to the pin. - `delay` uses the internal clock to pause for a given number of milliseconds.

← Back to topics for Physics