How To Use The New Arduino IDE 2.0
Arduino IDE 2.0 has been in beta since early 2021, we took a test drive in the early days and loved what we saw. When Arduino announced that his 2.0 had moved to stable release, we had to take it out for another spin.
Arduino IDE 2.0 brings many improvements over the original IDE. Most notably is the updated user interface. Here are some more improvements for end users.
Arduino IDE 2.0 introduces code autocomplete, which is useful when typing large sections of code. As you type, the IDE suggests available keywords/commands. This feature is standard in many other IDEs and a welcome addition to the Arduino IDE 2.0.
If you like your code editor dark, Arduino IDE 2.0 has many themes to choose from.
It’s in the File>>Settings menu. Change the theme to your liking and every aspect of the editor will cater to your needs.
Finally, the Serial Plotter has been updated to look better. Serial plotters are useful for measuring and interpreting analog signals and voltages.
Under the hood, Arduino IDE 2.0 improves board and software library compile times and in-app updates. Speaking of updates, Arduino IDE 2.0 can also be updated from the app, saving you the hassle of downloading the latest version from his website for Arduino.
Understanding the Arduino IDE 2.0
The best way to get to know your new IDE is to use it. In this how-to, you’ll download and install a new IDE and use it to create fun projects using NeoPixels.
1. Open your browser and Official Arduino website To download the installer for your operating system. I have Windows 11, so I downloaded the 64-bit version for my computer.
2. Follow the installation process When, Once done, launch the Arduino 2.0 IDE.
3. Allow the Arduino IDE to pass through the firewall. The IDE communicates with the server to ensure it has the latest versions and software libraries.
Four. Install the USB driver when prompted. This allows the Arduino IDE to communicate with various development boards such as the Arduino Uno and Raspberry Pi Pico.
New Arduino 2.0 IDE
The new IDE has a lot of “front of house” improvements and I have to say it looks great. Whether you’re new to Arduino or a seasoned pro, we’ve put together a quick reference to help you discover new features.
The Arduino 2.0 IDE has been significantly redesigned, but the most basic elements remain the same.
1. here is the sketcha (Sketch is the Arduino term for project file) Now write the code that creates the project.
2. Output area Once the code has been flashed to the microcontroller, you will see the output from installing new software libraries and debugging information.
What has changed is on the left side of the application. The new vertical menu includes quick access to many previously hidden but commonly used features.
1. Sketchbook: All your sketches here (our project) is included for fast access. Sketchbook includes a demo project for this how-to.
2. Board Manager: The Arduino IDE can be used with various boards. Here you can install support for them.
3. Library manager: This is where you can install, update, and remove your project’s software libraries. For example, you can install libraries for controlling NeoPixels, Wi-Fi and sensors.
Four. debug: Run the debug tool and you will see the errors in your code.
Five. seek: Use this to find a specific value in your project. Here we use the search to find a specific constant used to control the speed of the demo project.
6. Board selection: The Arduino IDE works with a wide variety of boards and this dropdown makes it easy to change boards and find the correct COM port.
Board configuration, software installation
Working on projects is the best way to learn a new IDE, especially one that looks as good as the Arduino IDE 2.0. Learn all new features and improve your workflow.
To test the Arduino 2.0 IDE, I created a simple project to create a simple RGB LED light show for a dark night using Adafruit’s NeoPixel library for Arduino boards.
1. Connect your Arduino Uno (or compatible) to your computer. Using a stock Arduino is the best option, but compatible boards work just as well.
2. Select Arduino from the board selection dropdown. This will configure the board and ports and make it ready for use. Other types of boards may require additional configuration.
3. Skip this step if you are using a genuine Arduino. [ボード]from the dropdown,[他のボードとポートを選択]Click.
4. Skip this step if you are using a genuine Arduino. Search for your board and select it and the correct port. If you don’t know the port, See our guide for more information.
Five. Click Library Manager When Search for Adafruit NeoPixel. Select Adafruit NeoPixel from the list and[インストール]Click.
Create a NeoPixel project
NeoPixels, Adafruit’s term for the WS2812B Addressable RGB LED, is a great way to introduce the microcontroller and the new Arduino IDE. why? Simply put, they are a lot of fun. You can control the color and brightness of each RGB LED to create animations and effects.
What you need for this project
The circuit for this project is simple. Our NeoPixel is connected to his 3 he GPIO pins on the Arduino. If you’ve never soldered before, don’t be afraid as soldering connections to the NeoPixel is easy.let’s see us How to solder pins to Raspberry Pi Pico A guide that teaches you the basics. If you need a soldering iron, Panelsil V2 The perfect iron for users of all budgets and levels.
wire color | Arduino GPIOs | neo pixel |
red | 5V | VCC/V/5V |
yellow | 6 | data in |
black | earth | earth |
It’s perfectly safe to connect up to 8 NeoPixels to an Arduino Uno, but more should be considered External power supply for NeoPixels
Adafruit’s NeoPixel library is used to control a short chain of NeoPixels to change colors from red to green to blue.
1. Click File >> New to create a new sketch. Clear the contents of the sketch.
2. Include the Adafruit NeoPixel library in your sketch. Python programmers will be familiar with this. In Python, import a module of code.
#include <Adafruit_NeoPixel.h>
3. Create three constants containing the GPIO pin used for the NeoPixel data pin, the pause (ms), and the number of LEDs in the chain. It uses GPIO pin 6, requires a 10 ms pause between LED color changes, and has 96 LEDs in the chain. Best practice is to keep the number of LEDs below 8 when using a 5V power supply with the Arduino. I used 96 briefly in this example to illustrate how long strips of NeoPixels work.
#define LED_PIN 6
#define PAUSE 10
#define LED_COUNT 96
Four. Declare a NeoPixel object When Pass the number of pixels (LEDs), the GPIO pin used, the configuration of the LEDs (RGB or GRB), and the pixel bitstream (usually 800 Hz).
Adafruit_NeoPixel strip(LED_COUNT, LED_PIN, NEO_GRB + NEO_KHZ800);
Five. Create and set up a function, use it to initialize the NeoPixel, turn off the LED, and set the brightness to 25. Brightness is a value between 0 and 255. A value of 25 is 10% brightness.
void setup() {
strip.begin();
strip.show();
strip.setBrightness(25);
}
6. Create a function to loop through and use the wipe action to set the LED colors to red, green, and blue. (We will create this function later). Add a delay of 10 milliseconds using the PAUSE constant.
void loop() {
colorWipe(strip.Color(255, 0, 0), PAUSE); // Red
colorWipe(strip.Color( 0, 255, 0), PAUSE); // Green
colorWipe(strip.Color( 0, 0, 255), PAUSE); // Blue
}
7. Create a function colorWipe that takes the color and delay time as arguments.
void colorWipe(uint32_t color, int wait) {
8. Inside the function, create a for loop that iterates over all the LEDs in the strip. Set the color of each pixel, then pause for 10ms and move to the next LED.
for(int i=0; i<strip.numPixels(); i++) {
strip.setPixelColor(i, color);
strip.show();
delay(wait);
}
}
complete code listing
#include <Adafruit_NeoPixel.h>
#define LED_PIN 6
#define PAUSE 10
#define LED_COUNT 96
Adafruit_NeoPixel strip(LED_COUNT, LED_PIN, NEO_GRB + NEO_KHZ800);
void setup() {
strip.begin();
strip.show();
strip.setBrightness(25);
}
void loop() {
colorWipe(strip.Color(255, 0, 0), PAUSE); // Red
colorWipe(strip.Color( 0, 255, 0), PAUSE); // Green
colorWipe(strip.Color( 0, 0, 255), PAUSE); // Blue
}
void colorWipe(uint32_t color, int wait) {
for(int i=0; i<strip.numPixels(); i++) {
strip.setPixelColor(i, color);
strip.show();
delay(wait);
}
}