Tuesday, April 27, 2021

Install arduino-esp32 2.0.0-alpha1 on Arduino IDE, Alpha preview with support for ESP32-S2 and ESP32-C3.

Currently (as on 2021-04-28), arduino-esp32 support ESP32-S2 and ESP32-C3 in development release 2.0.0-alpha1.


To install development release to Arduino IDE board manager:

Click in Arduino IDE Menu > File > Preferences

Enter development release link () in Additional Boards Manager URLs:
https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json

Open board manager:

Tools > Board > Boards Manager
Search and select esp32 by Esoressif systems, install the latest version, currentlt 2.0.0-alpha1.


After then, ESP32C3/ESP32S2 Dev Modules are available in board list.


~ release note of 2.0.0-alpha1



Exercise:
ESP32-S2:

ESP32-C3:

Sunday, April 25, 2021

Arduino read Playstation 2 compatible Wireless Controller using Arduino-PS2X

This exercise program Arduino Uno to read Playstation 2 compatible 2.4G Wireless Controller using Arduino-PS2X.





madsci1016/Arduino-PS2X is a Arduino Library to read PS2 controller. 

To install Arduino-PS2X to Arduino IDE, download and unzip the code's ZIP file. and place 'PS2X_lib' folder into your Arduino's libraries.

Restart the Arduino IDE, and open up the example sketch. 

Connect PS2 controller pins to Arduino following in the example:

#define PS2_DAT        13  //14    
#define PS2_CMD        11  //15
#define PS2_SEL        10  //16
#define PS2_CLK        12  //17

Wednesday, March 3, 2021

Install Arduino IDE 2.0 beta on Linux Mint 20.1, include ESP32/ESP8266 support.

Arduino IDE 2.0 (beta) is now available (refer to announcement in Arduino blog). It,s my first try to install Arduino IDE 2.0 beta (2.0.0-beta3) on Linux Mint 20.1, tested with VirtualBox 6.1/Windows 10.

Download Arduino IDE 2.0 beta

Visit https://www.arduino.cc/en/software, scroll download to download Arduino IDE 2.0 beta for Linux 64 bits (X86-64).

Run arduino-ide

Extract the downloaded file to a any folder you want. Run arduino-ide in Terminal
$ ./arduino-ide

Install board

In a fresh new installed Arduino IDE 2.0, no board is installed, you will be report with error:

Compilation error: Error: 2 UNKNOWN: platform not installed

Click Boards Manager on left, search to install Arduino AVR Boards by Arduino.

Add permission to user, to access USB

In a new Linux, you (as a regular user) have no permission to access USB port, and report with error:

avrdude: ser_open(): can't open device "/dev/ttyACM0": Permission denied

Open Terminal, enter the command to add permission:
$ sudo usermod -a -G dialout <username>
$ sudo chmod a+rw <port>

Done.



Install board support for ESP32/ESP8266


Menu > File> Preferences
Enter the url in the "Additional Board Manager URLs":

Then you can add board of ESP32/ESP8266 in Boards Manager.

Setup Python

By default Linux Mint 20.1 pre-install Python3, but no Python2. Currently, esptool for ESPs call python. You can create a symlinks /usr/bin/python to python3 by installing python-is-python3.

$ sudo apt install python-is-python3

Optionally, you can prevent Python 2 from being installed as a dependency of something in the future:

$ sudo apt-mark hold python2 python2-minimal python2.7 python2.7-minimal libpython2-stdlib libpython2.7-minimal libpython2.7-stdlib

And you have to install pyserial with pip:

$ sudo apt install python3-pip
$ pip3 install pyserial

Add permission to your user (if not do in above steps):

Additionally, if you cannot download your code to board caused by:
avrdude: ser_open(): can't open device "/dev/xxx": Permission denied

$ sudo usermod -a -G dialout <username>
$ sudo chmod a+rw <port>