In Part 4 of the M5Stack M5GO IOT StarterKit I will show you the M5GO Base and show how to use it.
Part 3 is available here: https://www.hackster.io/AJB2K3/m5go-iot-starter-kit-using-units-part-2-3613fa
Part 2 is available here: https://www.hackster.io/AJB2K3/m5go-iot-starter-kit-using-units-722343
Part 1 is available here: https://www.hackster.io/AJB2K3/m5go-iot-starter-kit-part-1-8ef6ae
The M5GO base is an extension module that is usable for all Generation 1 based M5Core's and came with the M5Go and M5Fire cores.
The M5GO base expands the Core with the range of additional functions listed below:
- 10X RGB split into 2 Set of 5 on each side,
- Dedicated Analog Port B,
- Dedicated UART Port C,
- Microphone.
The M5GO base module is connected to the Core using a 2X15 header that allows the connection of more expansion modules like the GoPlus (covered in part 5) and communication modules like Lora.
The RGB LEDsIn the base of the M5Go are 10 RGB LEDs. As of writing the base itself is not supported in UIFlow but we can use the RGB LEDs by adding an RGB Unit and setting the port to customs and the pins to GPIO15.
Once the port is set as shown in the above image, we can control the RGB LEDs using a code something like the following.
The Above code set all ten of the RGB LED's to the same colour selected from a colour picker that pops up once you click on the colour block. You can click on the arrow next to the word "Palette" and a drop down List will appear allowing you to chose to add the values as hexadecimal or decimal values. The RGB LED's are separated into two strips of five on each side of the base. RGB LED's 0 to 4 (RGB LED's always start at 0 and not 1) are on the right hand side while RGB LED's 5 to 9 are on the left hand side.
I am using the following code to show which side is which.
To change the brightness of the RGB LEDs you can use the Set Brightness block as shown in the next example:
The Set Brightness block accepts decimal values but we can place the Angle Units Get Analogue Value block with some maths blocks to manually control the RGB LED's brightness.
You may be wondering where the value of 655 comes from?
The Angle unit reads from 0 to 65535 but the RGB LEDs only have a brightness level value of 0 to 100. I divided the Angle units max value by the RGB LED Max Brightness value to give me 655 as the value that the Angle units has to be divided by to get a value of 0 to 100.
MicrophoneA PDM Microphone is connected to the base and is available by accessing GPIO34. As of writing this there is no way to use the microphone in the base.
IR LEDAn IR LED is connected in the base for transmitting only. As of writing there is no usable way to use the IR LED.
Comments
Please log in or sign up to comment.