Музыка на Arduino

Freebasic and Arduino

How to manage the Arduino board using USB connection.

Jeremy Blum in his book "Exploring Arduino. Tools and Techniques for Engineerig Wizardry" www.exploringarduino.com describes in "Chapter 6. USB and Serial Communication" usage of the Processing programming environment as supposedly simple and easy to learn. But this environment does not allow compiling programs without Java Runtime Environment and actually loads any compiled file with a huge JRE library. In my opinion, the same examples as in Blum’s book can be clearly and briefly programmed on FreeBasic

For the first experiment we do not need additional electronic components - we use on-board LED of Arduino. Download file sblinky.zip and program Arduino board by any example from the Arduino directory. In Freebasic directory write to file simpwrite.ini correct number and speed of COM port. Run the program simpwrite.exe or open in Freebasic IDE file simpwrite.bas Now if you move mouse cursor over the square in the center of the window, then on-board LED of Arduino will glow or blink. In the Processing directory there is a program for the Processing 3 environment.

For the second experiment you will need an RGB LED (or the usual red, green and blue LEDs) and 3 resistors of 220 Ohms. Download file srgb.zip and program Arduino board by program list_control.ino from the Arduino directory. In Freebasic directory write to file simpwrite.ini correct number and speed of COM port. Run the program blum140RGB.exe or open in Freebasic IDE file blum140RGB.bas Now when you clicks by mouse in the palette window, The RGB-LED will glow by color of in the specified palette pixel. In the Processing directory there is a program for the Processing 3 environment. At first glance, this program is much shorter than the program on Freebasic. But Freebasic allows you to create a very small EXE file that is independent of external libraries.

Download sblinky.zip (64 KB)

Download srgb.zip (70 KB)