Upload
others
View
9
Download
0
Embed Size (px)
Citation preview
IRM miniRelease 1.0.0
TAMC
Apr 10, 2022
CONTENTS
1 Hardware 31.1 Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41.2 Dimensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51.3 LED arrangment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61.4 Extension . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2 Software 132.1 Arduino . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132.2 Micropython . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142.3 CircuitPython . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3 Examples 153.1 Arduino single test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153.2 Arduino tile test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163.3 Micropython for ESP8266/ESP32 single test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173.4 Micropython for Raspberry Pi Pico single test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
4 WS2812 References 194.1 Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194.2 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194.3 Constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
i
ii
IRM mini, Release 1.0.0
Infinity RGB matrix mini, an 8 by 8 RGB matrix with possibility to extend “infinitely”. The idea of IRM mini is tohave connectors on 4 side, for you to connect it with multiple unit of IRM mini, to easlily and neetly expand it as yourwish.
CONTENTS 1
IRM mini, Release 1.0.0
2 CONTENTS
CHAPTER
ONE
HARDWARE
Infinity RGB matrix mini, an 8 by 8 RGB matrix with possibility to extend “infinitely”. The idea of IRM mini is tohave connectors on 4 side, for you to connect it with multiple unit of IRM mini, to easlily and neetly expand it as yourwish.
3
IRM mini, Release 1.0.0
1.1 Characteristics
Label Discription Value5V VDD, Power Input 3.5V~5.5VDIN Data Input 0.4V~VDD+0.4VVh DIN High Voltage 0.7xVDDVl DIN Low Voltage 0.3xVDDI Current 768mALv RGB Brightness Level 256DTR Data Transfer Rate 800kbps
4 Chapter 1. Hardware
IRM mini, Release 1.0.0
1.2 Dimensions
1.2. Dimensions 5
IRM mini, Release 1.0.0
1.3 LED arrangment
The first LED is on the top left cornor, and a little dot on top silkprint is showing where is the top left cornor of theboard.
The rest is going zigzag horizontally.
6 Chapter 1. Hardware
IRM mini, Release 1.0.0
1.4 Extension
To extend IRM mini, as it’s the main idea of IRM, you need to first flip all IRM mini units, than arrange it as you wish,for example, a 4x4 unit matrix to exceed a 16x16 led matrix.
1.4. Extension 7
IRM mini, Release 1.0.0
Than solder the solder pad together like this(You can add wires in between, for easier soldering.)
8 Chapter 1. Hardware
IRM mini, Release 1.0.0
This will make the top left unit the first, and than going zigzag again.
1.4. Extension 9
IRM mini, Release 1.0.0
You can see how the connection goes with in and out, and the special desige of the solder pad.
10 Chapter 1. Hardware
IRM mini, Release 1.0.0
You can also solder an extra power pad for a stronger structure. But do not solder neither In or Out
It’s not the only way to connect it, as all 4 side have both 5V, GND, In, Out. But there are rules should be follow.
1. In and Out in a set of connection MUST NOT be both connected.
2. The all boards MUST be connected in a single line, not with any branches, and not a loop.
3. Power line are parallel, and can be all solder together to provide stronger stuctures.
4. Avoid short circuit on any pins! A multi-meter checking after soldered is and good habit.
1.4. Extension 11
IRM mini, Release 1.0.0
12 Chapter 1. Hardware
CHAPTER
TWO
SOFTWARE
IRM mini uses WS2812, addressable RGB LED, or NeoPixel from Adafruit. So there are tons of libraries for it.Libraries from Adafruit have solutions of WS2812 matrix, and matrix of led matrix module, which is perfect for IRMmini and so it is recommended. Here we will mention some of the usage and configurations. But you can also use otherlibraries, and change configs according to the Hardware
2.1 Arduino
Warning: Before we recommanded to use Adafruit_NeoPixel and Adafruit_NeoMatrix but as a result, AdafruitNeo Matrix Library flip every zigzag line for easy wiring for other displays. But for IRM mini, we did not flip theline, so we fork the Adafruit_NeoMatrix and adapt it for IRM mini.
For Arduino install IRM Mini Arduino Library
Open Arduino IDE, click through Sketch, Include Library, Manage Libraries. . . . Search IRM mini, and install it.
Or manually download from GitHub: https://github.com/TAMCTec/irm-mini-arduino
Step 1: under https://github.com/TAMCTec/irm-mini-arduino, click Clone then Download ZIP
STEP 2: DO NOT unzip the ZIP file, goto Arduino IDE, click through Sketch, Include Library, Add .ZIP Library, andchoose the donloaded ZIP file.
Step 3: Now open an NeoMatrix example and change matrix settings to match your IRM mini.
// Change pin you are connecting to#define PIN 13
// Change the layout of the matrix#define TILE_WIDTH 6#define TILE_HEIGHT 2
13
IRM mini, Release 1.0.0
2.2 Micropython
For ESP32 and ESP8266
import machine, neopixel
n = 64PIN = 5
np = neopixel.NeoPixel(machine.Pin(PIN), n)
Checkout Controlling NeoPixels
For Raspberry Pi Pico or other RP2040 boards
2.3 CircuitPython
14 Chapter 2. Software
CHAPTER
THREE
EXAMPLES
3.1 Arduino single test
This is an example for a single IRM mini. It’s from Adafruit_NeoMatrix example with IRM mini settings.
#include <Adafruit_GFX.h>#include <Adafruit_NeoMatrix.h>#include <Adafruit_NeoPixel.h>#ifndef PSTR
#define PSTR // Make Arduino Due happy#endif
#define PIN 6
Adafruit_NeoMatrix matrix = Adafruit_NeoMatrix(8, 8, PIN,NEO_MATRIX_TOP + NEO_MATRIX_LEFT +NEO_MATRIX_COLUMNS + NEO_MATRIX_ZIGZAG,NEO_GRB + NEO_KHZ800);
const uint16_t colors[] = {matrix.Color(255, 0, 0), matrix.Color(0, 255, 0), matrix.Color(0, 0, 255) };
void setup() {matrix.begin();matrix.setTextWrap(false);matrix.setBrightness(40);matrix.setTextColor(colors[0]);
}
int x = matrix.width();int pass = 0;
void loop() {matrix.fillScreen(0);matrix.setCursor(x, 0);matrix.print(F("Howdy"));if(--x < -36) {
x = matrix.width();if(++pass >= 3) pass = 0;matrix.setTextColor(colors[pass]);
(continues on next page)
15
IRM mini, Release 1.0.0
(continued from previous page)
}matrix.show();delay(100);
}
3.2 Arduino tile test
This is an example for a tile of IRM mini. It’s from Adafruit_NeoMatrix example with IRM mini settings of 2x2.
#include <Adafruit_GFX.h>#include <Adafruit_NeoMatrix.h>#include <Adafruit_NeoPixel.h>#ifndef PSTR#define PSTR // Make Arduino Due happy#endif
#define PIN 6
Adafruit_NeoMatrix matrix = Adafruit_NeoMatrix(8, 8, 2, 2, PIN,NEO_TILE_TOP + NEO_TILE_LEFT + NEO_TILE_ROWS + NEO_TILE_ZIGZAG +NEO_MATRIX_TOP + NEO_MATRIX_LEFT + NEO_MATRIX_ROWS + NEO_MATRIX_ZIGZAG,NEO_GRB + NEO_KHZ800);
const uint16_t colors[] = {matrix.Color(255, 0, 0), matrix.Color(0, 255, 0), matrix.Color(0, 0, 255) };
void setup() {matrix.begin();matrix.setTextWrap(false);matrix.setBrightness(40);matrix.setTextColor(colors[0]);
}
int x = matrix.width();int pass = 0;
void loop() {matrix.fillScreen(0);matrix.setCursor(x, 0);matrix.print(F("Howdy"));if(--x < -36) {
x = matrix.width();if(++pass >= 3) pass = 0;matrix.setTextColor(colors[pass]);
}matrix.show();delay(100);
}
16 Chapter 3. Examples
IRM mini, Release 1.0.0
3.3 Micropython for ESP8266/ESP32 single test
from machine import Pinfrom ws2812 import WS2812import time
ws = WS2812(Pin(0), 64)
ws.brightness = 20
RED = [255, 0, 0]GREEN = [0, 255, 0]BLUE = [0, 0, 255]WHITE = [0, 0, 255]
for i in range(len(ws)):ws[i] = REDws.write()time.sleep(0.05)
for i in range(len(ws)):ws[i] = GREENws.write()time.sleep(0.05)
for i in range(len(ws)):ws[i] = BLUEws.write()time.sleep(0.05)
for i in range(len(ws)):ws[i] = WHITEws.write()time.sleep(0.05)
3.4 Micropython for Raspberry Pi Pico single test
from machine import Pinfrom ws2812 import WS2812import time
ws = WS2812(Pin(0), 64)
ws.brightness = 20
RED = [255, 0, 0]GREEN = [0, 255, 0]BLUE = [0, 0, 255]WHITE = [0, 0, 255]
for i in range(len(ws)):ws[i] = REDws.write()
(continues on next page)
3.3. Micropython for ESP8266/ESP32 single test 17
IRM mini, Release 1.0.0
(continued from previous page)
time.sleep(0.05)for i in range(len(ws)):
ws[i] = GREENws.write()time.sleep(0.05)
for i in range(len(ws)):ws[i] = BLUEws.write()time.sleep(0.05)
for i in range(len(ws)):ws[i] = WHITEws.write()time.sleep(0.05)
18 Chapter 3. Examples
CHAPTER
FOUR
WS2812 REFERENCES
4.1 Class
WS2812(pin, num): A class to control ws2812 RGB LED for RP2040 chip
from machine import Pinfrom ws2812 import WS2812ws = WS2812(Pin(0), 64)
4.2 Methods
WS2812.__setitem__(): Set led color buffer
# Set first LED to Redws[0] = [100, 0, 0]# Set second LED to Greenws[1] = 0x006400# Set the rest LED to Bluefor i in range(2, len(ws)):
ws[i] = [0, 0, 100]ws.write()
WS2812.__getitem__(): read led color buffer
print(ws[0])
WS2812.write(): Write buffer to LEDs
# Write all LED to white at onesfor i in range(len(ws)):
ws[i] = [20, 20, 20]ws.write()
# Write LED to red one at a timeimport timefor i in range(len(ws)):
ws[i] = [20, 20, 20]ws.write()time.sleep(0.1)
19
IRM mini, Release 1.0.0
4.3 Constants
WS2812.brightness: Brightness for all LEDs, from 0 to 255 WS2812.length: Length of LEDs WS2812.pin: thepin of LEDs
20 Chapter 4. WS2812 References