Download Arduino

According to your computer system, download the latest version of the corresponding software from the Arduino official https://www.arduino.cc/en/Main/Software
If it is a Linux system or Raspberry Pi, it is more convenient to use the sudo apt-get install arduino command to download.
Connect the serial port of Arduino and Bittle After the installation is complete, open the Arduino, and you can see the corresponding COM port at the “Tools-Port”. If the computer has multiple COM ports, please check in the computer’s device management.
Under windows, use the device manager.
Under Linux or Raspberry Pi, check the interface list in /dev/ttyUSB
Under Mac, view the interface list in /dev

Connection test

Turn on the Bittle switch, open the Arduino serial monitor, change the baud rate to 115200[RL1], and press the Bittle Reset button. If the code of Bittle test can be displayed in the serial port, the connection is successful.

Choose a development environment

Different from Petoi’s predecessor product Nybble, Bittle is designed based on the standard Arduino development board for the convenience of beginners, using the same official bootloader as the ATMega328PA (UNO development board) at 16MHz.
Open “Tools-Development Board” and select “Arduino UNO” in “Arduino AVR Boards”. At this point, the Arduino environment is set up.
Download Bittle’s code for secondary development If you only use Bittle’s default factory settings for teaching, this section can be skipped. Download the OpenCat code from GitHub: https://github.com/PetoiCamp/OpenCat It is best to use git clone to get all code and version control functions. Otherwise, please make sure to synchronize all the contents in the folder every time you download, because the codes are related to each other; There are some testX.ino codes in the ModuleTests folder to test each independent function module.
For example, you can use the simplest testBuzzer.ino as the first code you upload to verify the connection and settings, and test the function of the buzzer; Select Arduino UNO in the development board options and compile, there should be no error message. Some codes will pop up a warning, but do not affect the function. Click “Upload” to upload the code to NyBoard, Tx and Rx will flash quickly, indicating that it is communicating. The code will run on the board immediately after uploading. Click the magnifying glass icon in the upper right corner of the IDE to open the serial monitor. If the program has output, it will be displayed here.
Note that the baud rate of the serial monitor should be consistent with the serial initialization parameters in the program, we use 115200; If you need to enter some interactive commands in the serial monitor, make sure to set the terminator to “no terminator”. If set to other formats, it may cause the parsing program to understand errors.