SBK_BarDrive Library
2.1.2
LED bar meter control and queued animations for Arduino
Toggle main menu visibility
Loading...
Searching...
No Matches
genericMatrixDemo.ino
Go to the documentation of this file.
1
/**
2
* @file genericMatrixDemo.ino
3
* @brief Demonstrates a generic rows-by-columns matrix bar meter.
4
* @version 2.1.2
5
* @license MIT
6
*/
7
8
#include <Arduino.h>
9
10
#define SBK_BARDRIVE_WITH_ANIM
11
12
#include <SBK_MAX72xxSoft.h>
13
#include <SBK_BarDrive.h>
14
15
constexpr uint8_t DIN_PIN = A4;
16
constexpr uint8_t CLK_PIN = A5;
17
constexpr uint8_t CS_PIN = A3;
18
19
SBK_MAX72xxSoft driver(DIN_PIN, CLK_PIN, CS_PIN, 1);
20
SBK_BarDrive<SBK_MAX72xxSoft> bar(
21
&driver, 0, 4, 7, BarDirection::FORWARD);
22
23
void setup()
24
{
25
Serial.begin(115200);
26
driver.begin();
27
28
// A generic 4 x 7 matrix contains 28 logical segments.
29
Serial.print(F("Generic matrix segments: "));
30
Serial.println(bar.getSegsNum());
31
32
bar.animations().animInit().bounceFillUpIntv(25).loop();
33
}
34
35
void loop()
36
{
37
bar.animations().update();
38
bar.show();
39
}
examples
genericMatrixDemo
genericMatrixDemo.ino
Generated by
1.18.0