【 Arduino LEONARDO 】What are they? + Features and Utility ▷ 2022

The special features that Arduino Leonardo has You can find them in the following paragraphs of this article. We will explain, in a simple way, what this is for free hardware board.

Also, you will be able to know the main benefits that Arduino Leonardo has and what are the components it uses. Being one of the most important, the distribution of its pins on the bus.

But this is not all you will find in the post, we will also introduce you to the most interesting projects that you can create yourself with Arduino Leonardo. Continue reading and become a true expert in electronics.

What is Arduino Leonardo and what is this free development board for?

Arduino Leonardo it is a board with an ATmega32u4 MCU, 32KB flash memory and 2.5KB static. It has a hardware USB port so serial-USB conversion is not necessary, this allows you can work on a large number of projects and use peripherals (such as a keyboard or mouse) to improve user comfort.

It differs with because it has 20 digital pins, of which it can distribute 12 for analog inputs and 7 for pulse modulation, which can support a maximum input and output current of 40 mA. This plate offers great versatility thanks to the anatomy it offers .

What are the most interesting features of the Arduino Leonardo development boards?

The main characteristics that Arduino Leonardo has are:

  • Relative to other plates the Arduino Leonardo has more pins. This allows you to include more elements at the same time, so there is no need to add more circuits to complex projects.
  • SRAM static memory has more capacity than Arduino UNO (the most used plate), since it is 2.5 KB which benefits those projects where speed in processing is needed.
  • The dimensions are similar to those of other boards, so it can be included in any type of project. This also brings the benefit that its cost is not high.
  • By having native portsyou can directly connect peripherals that help improve the handling and programming of the board.
  • On the official page of Arduino there are libraries that can be easy to access and use .

Anatomy of the Arduino Leonardo What are the components it uses?

The components used in an Arduino Leonardo board are:

  • its dimensions totals are 68.6×53.3mm with an approximate weight of 20 grams.
  • The mcu is a model microcontroller Atmel ATmega32u4 who works at 16Mhz.
  • The flash memorysubtracting the 4 KB of the bootloader, is 28 KB.
  • EEPROM is 1KBwhile the SRAM memory is 2.5 KB.
  • own the pins A0 to A11 as analog inputs, while for PWM the pins 3, 5, 6, 9, 10, 11 and 13.
  • It has an I2C bus in which it locates the data line and the clock line in the pins 2 and 3respectively.
  • Dispose of a 6-pin male connector used for communication ICSPthis is an important difference with respect to other boards, since the others have different pins for SPI communication.
  • the pins 3, 2, 0, 1, and 7 it is used for the external interruption of type 0, while for the interruption 1 it has the pins 0, 1, 2, 3, and 4.
  • The port for the USB connection is of type A-micro B.
See also  【 START Windows 10 in Safe Mode 】▷ Step by Step Guide ▷ 2022

List of the most interesting projects that you can create yourself with Arduino Leonardo

In the steps that follow you will find the best projects that you can create yourself with an Arduino Leonardo board:

keyboard extension

You will be able to use an Arduino Leonardo board in a project that allows you to add capacitive touch keys and then customize them. For this you will need, in addition to the plate Arduino Leonardo, necessary quantity of capacitive touch sensors, a breadboard cables for the connection. The first thing you will have to do is mount by inserting the cables into the connectors and then create the hotkeys.

For this you will have to enter:

#include const int delayValue = 100; const char cmdKey = KEY_LEFT_GUI; void setup(){ pinMode(2, INPUT); pinMode(3, INPUT); pinMode(4, INPUT); pinMode(5, INPUT); begin(); } void loop(){ if (digitalRead(2)) { press(cmdKey); press(‘c’); delay(delayValue); releaseAll(); while(digitalRead(2)); } if (digitalRead(3)) { press(cmdKey); press(‘v’); delay(delayValue); releaseAll(); while(digitalRead(3)); } if (digitalRead(4)) { press(cmdKey); press(‘n’); delay(delayValue); releaseAll(); while(digitalRead(4)); } if (digitalRead(5)) { press(cmdKey); press(‘z’); delay(delayValue); releaseAll(); while(digitalRead(5)); } }

Then you must enter the following codes to finish programming:

#include void setup() { pinMode( 2 , INPUT ); pinMode(3, INPUT); pinMode(4, INPUT); pinMode(5, INPUT); Keyboard . begin (); } void loop() { checkPress( 2, ‘d’ ); checkPress(3, ‘f’); checkPress(4, ‘g’); checkPress(5, ‘h’); } void checkPress ( int pin , char key ) { if ( digitalRead ( pin )) { Keyboard . press ( key ); } else { Keyboard . release( key ); } }

Program your CNC machine

you will need a badge Arduino Leonardo and push buttons to convert to your machine CNC with a wooden pendant. This project will help you move the wheel and keep the rest of the team quiet when you work. You will be able to incorporate different switches, modify the size of the command and choose a steering wheel that suits your needs.

See also  【 Mention Someone on Twitter 】 Step by Step Guide ▷ 2022

After assembling the pieces you will have to program the following codes in the Arduino IDE:

#include “ClickButton.h” #include “Keyboard.h” long int aux1_delay = 0 ; buttons int const = 20 ; const int buttonPin0 = 0 ; const int buttonPin1 = 0 ; const int buttonPin2 = 1 ; const int buttonPin3 = 2 ; const int buttonPin4 = 3 ; const int buttonPin5 = 4 ; const int buttonPin6 = 5 ; const int buttonPin7 = 6 ; const int buttonPin8 = 7 ; const int buttonPin9 = 8 ; const int buttonPin10 = 9 ; const int buttonPin11 = 10 ; const int buttonPin12 = 11 ; const int buttonPin13 = 12; const int buttonPin14 = 13; const int buttonPin15 = A0; const int buttonPin16 = A1; const int buttonPin17 = A2; const int buttonPin18 = A3; const int buttonPin19 = A4; const int buttonPin20 = A5; { ClickButton(buttonPin0, LOW, CLICKBTN_PULLUP), ClickButton(buttonPin1, LOW, CLICKBTN_PULLUP),

  • Keep going in the same way until buttonPin20then close SDI with };

Then you will have to continue entering these codes:

void setup() { for (int i = 1; i <= buttons; i++) { button.debounceTime = 20; button.multiclickTime = 250; button. longClickTime = 1000; } } void loop() { for (int i = 1; i <= buttons; i++) { button.Update(); } if (button.clicks != 0) { switch (button.clicks) { case 1: // Single click press_RESET(); break; case 2: // Double click press_ESC(); break; case 3: // Triple click break; case -1: // Single Click and Hold // TURN DRIVERS OFF press_ESC(); goto_MACHINE_IO_MENU(); press_F2(); goto_MAIN_MENU(); break; case -2: // Double Click and Hold break; case -3: // Triple Click and Hold break; } } if (button.clicks != 0) { switch (button.clicks) { case 1: // Single click press_ESC(); goto_MAIN_MENU(); break; case 2: // Double click break; case 3: // Triple click break; case -1: // Single Click and Hold break; case -2: // Double Click and Hold break; case -3: // Triple Click and Hold break; } } if (button.clicks != 0) { switch (button.clicks) { case 1: // Single click break; case 2: // Double click break; case 3: // Triple click break; case -1: // Single Click and Hold press_ESC(); goto_MAIN_MENU(); shortcut_HOME_ALL(); break; case -2: // Double Click and Hold break; case -3: // Triple Click and Hold break; } } if (button.clicks != 0) { switch (button.clicks) { case 1: // Single click // TOGGLE MDI shortcut_TOGGLE_MDI(); break; case 2: // Double click break; case 3: // Triple click break; case -1: // Single Click and Hold break; case -2: // Double Click and Hold break; case -3: // Triple Click and Hold break; } }

See also  【 4th GENERATION of COMPUTERS 】 Highlights ▷ 2022

From here you can add for each button what actions you want it to do. You can break, start the timer, wait, etc. For the modifier keys you will have to use these definitions set by Arduino Leonardo. We are going to express first the key, then the hexadecimal value and finally its decimal value.

Watch below:

KEY_LEFT_CTRL 0x80 128 KEY_LEFT_SHIFT 0x81 129 KEY_LEFT_ALT 0x82 130 KEY_LEFT_GUI 0x83 131 KEY_RIGHT_CTRL 0x84 132 KEY_RIGHT_SHIFT 0x85 133 KEY_RIGHT_ALT 0x86 134 KEY_RIGHT_GUI 0x87 135 KEY_UP_ARROW 0xDA 218 KEY_DOWN_ARROW 0xD9 217 KEY_LEFT_ARROW 0xD8 216 KEY_RIGHT_ARROW 0xD7 215 KEY_BACKSPACE 0xB2 178 KEY_TAB 0xB3 179 KEY_RETURN 0xB0 176 KEY_ESC 0xB1 177 KEY_INSERT 0xD1 209 KEY_DELETE 0xD4 212 KEY_PAGE_UP 0xD3 211 KEY_PAGE_DOWN 0xD6 214 KEY_HOME 0xD2 210 KEY_END 0xD5 213 KEY_CAPS_LOCK 0xC1 193 KEY_F1 0xC2 194 KEY_F2 0xC3 195 KEY_F3 0xC4 196 KEY_F4 0xC5 197 KEY_F5 0xC6 198 KEY_F6 0xC7 199 KEY_F7 0xC8 200 KEY_F8 0xC9 201 KEY_F9 0xCA 202 KEY_F10 0xCB 203 KEY_F11 0xCC 204 KEY_F12 0xCD 205

An example of programming these keys is:

void press_RESET() { begin(); press(KEY_F1); delay(100); releaseAll(); } void press_ESC() { begin(); press(KEY_ESC); delay(100); releaseAll(); } void press_F2() { begin(); press(KEY_F2); delay(100); releaseAll(); } void press_F3() { begin(); press(KEY_F3); delay(100); releaseAll(); }

Motion sensor

with this project you will be able to create a radar that turns on a led light when it detects movement in a nearby area. For this you will need a plate Arduino Leonardo, an ultrasonic sensor, a stepper motor, LED lights and cables to assemble. The next step will be mount the components and type the following commands for led light and ultrasonic sensor.

These are:

{Long duration; pinMode(trigPin, OUT); pinMode(echoPin, INPUT); digitalWrite(trigPin, LOW); delayMicroseconds(2); digitalWrite(trigPin, HIGH); delay Microseconds (20); digitalWrite(trigPin, LOW); duration = pulseIn(echoPin, HIGH); duration = duration / 59; if ((duration < 2) || (duration > 300)) returns false; return duration; } void setup() { Serial.begin(9600); digitalWrite(6, LOW); pinMode(5, OUTPUT); } void loop() { Serial.print(“distance:”); print(“”); print(ardublockUltrasonicSensorCodeAutoGeneratedReturnCM(6, 7)); print(“”); println(); Yes…

Loading Facebook Comments ...
Loading Disqus Comments ...