//// SerialPort4 //// simple demo patches with arduino or MicroPython , microprocessor code on a frame

For people that want to start tinkering and learning arduino and gamma together:

BLINK THE ARDUINO ONBOARD LED, WITH A HOLDING BUTTON IN GAMMA.

blink led with one character.vl (14.1 KB)
This one is for the arduino, change your COM port and the baudrate, so it matches your board

3 Likes

this is for send three differents messages as one string, and separate the strings in micropython, and show the result in the MICROBIT onboard led matrix:


enviar 3 messages a microbit_MicroPython.vl (49.1 KB)

2 Likes

more of this upcoming, just follow the thread.

Hey, just to let you know I moved your thread to the WIP category, which better fits the purpose of your post.

Thnks!!

RECIEVING X, Y DATA FROM A NUNCHUK JOYSTICK


RECIEVE JOYSTICK DATA FROM A NUNCHUK, USING ARDUINO (Raspb erry Pi Pico in this case) AND I2C VIA SERIAL.vl (55.9 KB)

Here is a way of recieve data in the correct way , with the correct serial print format, and the way to separate the incoming data and clean it from the separator (,).

*Hope you can catch the workflow, but more examples are coming, It will have the shape of a library with examples probably, for those who love to control gadgets and do physical computing in gamma and arduino.

*For the very novices, the code in the box is arduino code, which you have to copy and paste in the arduino IDE and compile it, before you can make the gamma patch work.

Send RGB values via serial port for lit a rgb Led , or whatever you need.

This patch it’s very useful, because it shows how to gather all the values we want to send to the Arduino, and make a unique message with separators (commas in this case), so the Arduino code knows what character to use for slice the message in three elements (R, G, B), reassign to variables, so u can do whatever you want with this values in your microcontroller.

Send RGB values via the serial Port.vl (62.4 KB)

It is important to learn how to use the serial port node , even we have the Firmata node because there are many different types of shields, sensors, and other devices that have their own libraries, and use more obscure protocols other that analog/digital read or write.

Additionally, there are many edge sensors and robotics actuators that use UART , ISP or I2C communication.
The good thing about Arduino is that there is a library for almost everything, making it easy to use as a mild form of C++. Knowing how to send and receive data through the serial port allows you to take full advantage of all the libraries and communitty examples .

Additionally, if you plan on working with stepper motors, DC motors with encoders or brushless DC motors, it is recommended to use Phidgets. They are easy to wire and have proven to be precise and safe. Additionally, there is a NuGet package available to use with Phidgets, which eliminates the need to use Arduino or C++ coding for serial communication.