How to learn Arduino programming using a free Arduino Simulator in 2021?

Arduino Mega, Arduino Nano and Arduino UNO — you can program all using Arduino Simulators
You can use many more devices and learn how to program

Introduction

A small introduction to the Arduino boards you see around (skip if you want 😁)

Arduino Project 1: Blinking an LED — Basics💡

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
}
pinMode(LED_BUILTIN, OUTPUT);
Arduino Blink basic example of a free Arduino simulator

Arduino Project 2: buttons!

Arduino LED and a push-button project on Wokwi Arduino simulator

Get to know the Arduino simulator

Arduino Project 3: Learn about printing text on serial data/serial plotter

serial plotter example on the Arduino simulator

Arduino Project 4: Play with the projects with LCD1602 (and LCD2004)

LCD2004 and Arduino on wokwi Arduino simulator

Arduino Project 5: Learn about membrane keypads and Arduino

/* Keypad setup */
const byte KEYPAD_ROWS = 4;
const byte KEYPAD_COLS = 4;
byte rowPins[KEYPAD_ROWS] = {5, 4, 3, 2};
byte colPins[KEYPAD_COLS] = {A3, A2, A1, A0};
char keys[KEYPAD_ROWS][KEYPAD_COLS] = {
{'1', '2', '3', '+'},
{'4', '5', '6', '-'},
{'7', '8', '9', '*'},
{'.', '0', '=', '/'}
};
Keypad keypad = Keypad(makeKeymap(keys), rowPins, colPins, KEYPAD_ROWS, KEYPAD_COLS);
The keypads can be customised easily on the Arduino simulator

Arduino Project 6: Learn about Servo motors

#include <Servo.h>
Servo myservo; // create servo object to control a servo 
// twelve servo objects can be created on most boards
void setup() {
myservo.attach(9); // attaches the servo on pin 9 to the servo object
}
void loop() {
for (pos = 0; pos <= 180; pos += 1) { // goes from 0 degrees to 180 degrees
// in steps of 1 degree
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}
for (pos = 180; pos >= 0; pos -= 1) { // goes from 180 degrees to 0 degrees
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}
}

Arduino Project 7: Learn about driving smart LEDs (1/3)

#include <FastLED.h>
// How many leds in your strip?
#define NUM_LEDS 1
// For led chips like WS2812, which have a data line, ground, and power, you just
// need to define DATA_PIN. For led chipsets that are SPI based (four wires - data, clock,
// ground, and power), like the LPD8806 define both DATA_PIN and CLOCK_PIN
// Clock pin only needed for SPI based chipsets when not using hardware SPI
#define DATA_PIN 3
#define CLOCK_PIN 13
// Define the array of leds
CRGB leds[NUM_LEDS];
void setup() {
// Uncomment/edit one of the following lines for your leds arrangement.
// ## Clockless types ##
FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS); // GRB ordering is assumed
}
void loop() {
leds[0] = CRGB::Red;
FastLED.show();
delay(500);
leds[0] = CRGB(241, 28, 206);
FastLED.show();
delay(500);
leds[0] = CRGB(28, 25, 226);
FastLED.show();
delay(500);
leds[0] = CRGB(35, 201, 13);
FastLED.show();
delay(500);
leds[0] = CRGB(241, 245, 10);
FastLED.show();
delay(500);
}
CRGB leds[NUM_LEDS];
FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS); // GRB ordering is assumed
FastLED.show();

Arduino Project 8: Learn about driving smart LEDs (2/3)

WS2812 LED strip example on Arduino Simulator
// Source: https://github.com/s-marley/FastLED-basics
#include <FastLED.h>
#define NUM_LEDS 18
#define LED_PIN 2
CRGB leds[NUM_LEDS];
void setup() {
FastLED.addLeds<WS2812B, LED_PIN, GRB>(leds, NUM_LEDS);
FastLED.setBrightness(50);
}
void loop() {
leds[0] = CRGB::Red;
leds[1] = CRGB::Green;
leds[2] = CRGB::Blue;
FastLED.show();
}

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store