Bus Terminal Signs 1.0.0
Hull Bus Station Dot Matrix Displays
Loading...
Searching...
No Matches
CH_AS1100.h
Go to the documentation of this file.
1
6#pragma once
7
8#include <arduino.h>
9#include <Adafruit_GFX.h>
10
11class Panel : public Adafruit_GFX
12{
13public:
14 Panel(int LoadPin, int NumChips);
15 ~Panel();
16
17 bool begin(); // initialises CLK,LOAD,DATA signal states
18 void display(void); // called to send pixels to the display
19 void fillDisplay(int state); // state=1 leds on, state=0 leds off. Call display() after
20 void clearDisplay(void);
21 void invertDisplay();
22
23 void drawPixel(int16_t x, int16_t y, uint16_t color) override; // essential for GFX
24 // void drawLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1,uint16_t color);
25
26 void setClockMode(int m);
27 void displayTest(bool state); // all leds turned on if state is true, off if false
28 void setBinaryMode();
29 void setScan(int totaldigits);
30 void setIntensity(int level, int chip); // sets intensity of one or all chips (-1 default)
31 void setIndividualIntensity(int chips[]); // provide an array of intensities, one per chip
32
33 void displayOn(int b); // 1=on, 0=off. Entire matrix is turned on/off
34 void sendPixels();
35 void setPixel(int x, int y, uint8_t on); // pixels can only be on or off
36 uint8_t getPixel(int x, int y);
37
38 void scrollRow(int dir, int row, bool wrap);
39 void scrollRows(int dir, bool wrap);
40 void scrollColumn(int dir, int col, bool wrap);
41 void scrollColumns(int dir, bool wrap);
42
43 void dumpPixels();
44
45private:
46 void load();
47 void write16(int d);
48 void writeDigit(int digit, uint8_t d); // used by display()
49
50 void showCell(int x, int y, int val);
51 void sendCmd(int cmdData);
52
53 int _loadPin = 0;
54 int _clkPin = 0;
55 int _dataPin = 0;
56
57 // hardware related
58 int _numChips = 0; // assigned in constructor to allow for variable length panels
59 int _numColumns = 0;
60
61 uint8_t *pixels[8]; // each chip has 8 rows and 6 segments
62};
Definition: CH_AS1100.h:12
void scrollColumn(int dir, int col, bool wrap)
Scrolls a single column with optional wrap around.
Definition: CH_AS1100.cpp:524
void sendPixels()
sends the pixel array to the panel chips
Definition: CH_AS1100.cpp:363
void scrollRow(int dir, int row, bool wrap)
Scroll an entire row.
Definition: CH_AS1100.cpp:477
void dumpPixels()
displays the contents of the pixel array for debugging
Definition: CH_AS1100.cpp:77
void displayOn(int b)
Turns the panel on/off. This needs to be called to see anything. Can be called to flash the display s...
Definition: CH_AS1100.cpp:414
void displayTest(bool state)
LED test. Regardless of programming, this turns on/off all LEDs.
Definition: CH_AS1100.cpp:429
void setScan(int totaldigits)
Definition: CH_AS1100.cpp:460
void scrollRows(int dir, bool wrap)
scroll ALL rows by calling scrollRow for each row
Definition: CH_AS1100.cpp:507
void setIndividualIntensity(int chips[])
Sets all the chips' intensities with one function.
Definition: CH_AS1100.cpp:301
void clearDisplay(void)
equivalent to fillDisplay(0)
Definition: CH_AS1100.cpp:239
void drawPixel(int16_t x, int16_t y, uint16_t color) override
use setPixel instead
Definition: CH_AS1100.cpp:190
void scrollColumns(int dir, bool wrap)
Scrolls all columns up or down one pixel on each call.
Definition: CH_AS1100.cpp:557
void display(void)
sends the pixel buffer to the display.
Definition: CH_AS1100.cpp:209
void setBinaryMode()
Definition: CH_AS1100.cpp:448
~Panel()
frees memory used for the pixel array
Definition: CH_AS1100.cpp:59
void setIntensity(int level, int chip)
Sets the intensity of one AS1100 chip (character) or ALL chips if chip=-1. Note: you cannot set the i...
Definition: CH_AS1100.cpp:265
bool begin()
initialises the panel. Clears the display and makes the display visible
Definition: CH_AS1100.cpp:113
void setPixel(int x, int y, uint8_t on)
Toggle individual pixel. You must call display() after.
Definition: CH_AS1100.cpp:336
void invertDisplay()
switches LED states from off to on and vice versa
Definition: CH_AS1100.cpp:247
uint8_t getPixel(int x, int y)
returns a pixel state as 1 (on) or 0 (off)
Definition: CH_AS1100.cpp:315
void setClockMode(int m)
Definition: CH_AS1100.cpp:400
void fillDisplay(int state)
Sets the entire pixel buffer to off or on if state is 0 the leds are all off is state is non-zero the...
Definition: CH_AS1100.cpp:220