Skillnad mellan versioner av "Grove - LED Matrix Driver"
(2 mellanliggande versioner av samma användare visas inte) | |||
Rad 1: | Rad 1: | ||
− | + | [[Fil:Grove-LED-Matrix-Driver.jpg|200px|thumb|right|Grove - LED Matrix Driver]] | |
== Kompatibilitet == | == Kompatibilitet == | ||
Rad 69: | Rad 69: | ||
[[Category:Grove]] | [[Category:Grove]] | ||
+ | [[Category:Grove-Actuator]] | ||
+ | [[Category:Kna-Wiki]] |
Nuvarande version från 4 februari 2021 kl. 07.41
Innehåll
Kompatibilitet
- Arduino
- Raspberry Pi
Port
- Digital
Bibliotek
https://github.com/Seeed-Studio/Grove_LED_Matrix_Driver
Exempelkod
Arduino
#include <SoftwareSerial.h>
#include "LEDMatrix.h"
// Note: You must define a SoftwareSerial class object that the name must be "matrix_serial",
// but you can change the pin number according to the actual situation.
#define RECEIVE_PIN 2
#define TRANSMIT_PIN 3
SoftwareSerial matrix_serial(RECEIVE_PIN, TRANSMIT_PIN);
LEDMatrix led;
void setup()
{
}
void loop()
{
/****************************************************************
* Function Name: void LEDMatrix::displayChar(uint8_t x, uint8_t y, char c, font_size font, led_color color)
* Description: Display character.
* Parameters: x: X Position
* y: Y Position
* c: ASCII code:'c' or 0-127(Dec)
* font: FONT_6X8 \ FONT_8X12 \ FONT_10X16 \ FONT_12X16
* color: led color, RED or GREEN.
* Return: none
****************************************************************/
int i;
led.clear(); // clear screen
led.displayChar(5, 0, 'W', FONT_6X8, RED);
led.displayChar(5, 10, '8', FONT_6X8, RED);
led.displayChar(5, 20, '&', FONT_8X12, GREEN);
for (i = 0; i <= 127; i++)
{
led.displayChar(20, 0, i, FONT_8X12, GREEN); // display Char. ASCII Value Range(Dec):0-127
delay(2000);
}
while(1);
}