noah1510 / ledcontroller Goto Github PK
View Code? Open in Web Editor NEWThis project forked from wayoda/ledcontrol
An Arduino library for MAX7219 and MAX7221 Led display drivers
License: GNU Lesser General Public License v3.0
This project forked from wayoda/ledcontrol
An Arduino library for MAX7219 and MAX7221 Led display drivers
License: GNU Lesser General Public License v3.0
Hey,
I get the following errors when I try to compile a program for the ESP32 Dev C module:
.../src/LedController.cpp: In member function 'std::array<unsigned char, 20u> LedController::moveDown(std::array<unsigned char, 20u>)':
.../src/LedController.cpp:481:32: error: could not convert 'makeCppByteBlock(((byte*)(& shiftedOutRow)))' from 'std::array<unsigned char, 8u>' to 'std::array<unsigned char, 20u>'
return makeCppByteBlock(shiftedOutRow);
^
.../src/LedController.cpp: In member function 'std::array<unsigned char, 20u> LedController::moveUp(std::array<unsigned char, 20u>)':
.../LedController/src/LedController.cpp:489:32: error: could not convert 'makeCppByteBlock(((byte*)(& shiftedOutRow)))' from 'std::array<unsigned char, 8u>' to 'std::array<unsigned char, 20u>'
return makeCppByteBlock(shiftedOutRow);
^
.../src/LedController.cpp: In member function 'std::array<unsigned char, 8u> LedController::reverse(std::array<unsigned char, 8u>)':
.../src/LedController.cpp:496:38: error: no matching function for call to 'LedController::reverse(std::array<unsigned char, 8u>::pointer, byte ()[20])'
reverse(input.data(), &output);
^
.../src/LedController.cpp:308:6: note: candidate: byte LedController::reverse(byte)
byte LedController::reverse(byte var){
^
.../src/LedController.cpp:308:6: note: candidate expects 1 argument, 2 provided
.../src/LedController.cpp:436:6: note: candidate: void LedController::reverse(byte, byte ()[8])
void LedController::reverse(C_ByteBlock input, C_ByteBlock reversedInput){
^
.../src/LedController.cpp:436:6: note: no known conversion for argument 2 from 'byte ()[20] {aka unsigned char ()[20]}' to 'byte ()[8] {aka unsigned char ()[8]}'
.../src/LedController.cpp:493:15: note: candidate: std::array<unsigned char, 8u> LedController::reverse(std::array<unsigned char, 8u>)
ByteBlock LedController::reverse(ByteBlock input){
^
.../src/LedController.cpp:493:15: note: candidate expects 1 argument, 2 provided
.../src/LedController.cpp: In member function 'std::array<unsigned char, 8u> LedController::rotate180(std::array<unsigned char, 8u>)':
.../src/LedController.cpp:504:40: error: no matching function for call to 'LedController::rotate180(std::array<unsigned char, 8u>::pointer, byte ()[20])'
rotate180(input.data(), &output);
^
.../src/LedController.cpp:446:6: note: candidate: void LedController::rotate180(byte, byte ()[8])
void LedController::rotate180(C_ByteBlock input, C_ByteBlock rotatedInput){
^
.../src/LedController.cpp:446:6: note: no known conversion for argument 2 from 'byte ()[20] {aka unsigned char ()[20]}' to 'byte ()[8] {aka unsigned char ()[8]}'
.../src/LedController.cpp:501:15: note: candidate: std::array<unsigned char, 8u> LedController::rotate180(std::array<unsigned char, 8u>)
ByteBlock LedController::rotate180(ByteBlock input){
^
.../src/LedController.cpp:501:15: note: candidate expects 1 argument, 2 provided
exit status 1
Fehler beim Kompilieren für das Board ESP32 Dev Module.
Do you have any suggestion on how to fix this?
Cheers
Lennart
At the moment only MAX7219 and MAX7221 are expected to work correctly.
I the future all of the code in LedController_low_level.hpp
should get refactored.
LedController_low_level.hpp
I don't know when this will be done but it might be a good issue if you want to get started contributing to open source projects.
At the moment setColumn is broken and ruins everything displayed on the matrix causing random LEDs to be set.
I tried loading the examples from the manual page: https://noah1510.github.io/LedController/english/examples.html
All of them give me 404. I wouldn't mention it, but I need to read them; I don't understand the new library, how to set it up, the V2 example programs compile but don't do anything, and of course I can't upgrade existing sketches.
Or if you could make the V1 documentation available, I could fix the old programs and then upgrade.
You'll be pleased to hear that (WITH V1.7) I WAS using NodeMCU (ESP8266) processor with no issues, using D0, D1 and D2 for CLK, CS and DIN. There may be better pins, but NodeMCU has weird names for the pins and I am also using an SPI display on D3,4,5,7,8, with TFT_eSPI library, so I don't have any other spare pins.
this issue is just a reminder to remove functions that are marked to be removed for the release just before the release.
At the moment the movement functions only work if you use an LED Matrix.
It would be nice to have the option to also move data when you have 7-Segment Displays connected.
The following points are what needs to be done in order for this to work.
If you think that anything is missing feel free to mention it, I will add it to the list.
The list might change in the future depending on how the implementation will work out.
The goal is to allow for a single LedController to control more than one row.
Each row may be connected to a different CS Pin.
The initial bits are in place, now a lot of functions need to be overwritten to support writing to/reading from segment in a position like (3,4).
There also needs to be a change to the move functions since they will behave different when there are multiple rows.
All those changes should have backwards compatibility in mind, so that code that uses the movement functions does not break.
this issue is just a reminder to remove functions that are marked to be removed for the release just before the release.
This feature should make things a lot easier.
It is an option for the controller_configuration to allow different rotation values.
This allows for a custom rotation in 90 degree steps to adjust to functions according to the actual layout of the segments.
moveRight will move the data right even if the matrix is rotated and the set functions will set the correct values.
This will require a lot of changes to the codebase and is not recommended for beginners unfamiliar with templates and the internal structure of the code.
Hey,
unfortunately, setting the segments to something greater than 8 creates an error on the Nano:
LedController.hpp:55:28: note: type 'byte[8][8]' should match type 'byte[20][8]'
using Matrix = C_Matrix;
Best
l.
There are some topics that do not have documentation pages at the moment.
They will be added for version 2.1.0 and this issue contains a list of those pages.
If you think some other page is also missing please leave a comment.
The documentation needs some more work.
All of this should be done before version 2.0.0 is released.
For more suggestions on missing documentation please leave a comment
Hey
is there a way to read the state of an LED?
I'd really like to have a function like this:
boolean getLed(unsigned int segmentNumber, unsigned int row, unsigned int column)
(This would reduce the need for me store the state in an array. And since I am using 20 8x8 matrixes I am running low on variable storage memory :-) )
Cheers
l.
Add a new classes similar to the byteBlock but for a row for the same reasons.
the old functions will be removed in version 2.2.0 and will be marked as deprecated as of version 2.0.0
As part of version 2.2.0 the library should be split into several modules.
If every module should be used LedController.hpp
should be included but it should also be possible to only include some of the modules.
For this to work the class declaration has to be split into the following parts:
This way compiled programs can be smaller for cases where there is limited program storage and some functions are not needed. So for example LedController_core.hpp
can be included to have access to all of the core functions without using any of the additional features.
Feel free to propose more modules that could be implemented/split to add them to the list.
Hello,
I try your library with the idea to built a 5 axis machine display. using esp32dev as processor. The axis are selected with the cs pin but the value can be positive, negative and the decimal place on a certain position.
Is that possible ?
One of the features that could increase compatibility to almost 100% would be to write a custom SPI Arduino layer.
Except for Arduino.h
and SPI.h
are the only dependencies, but they do not exist for a lot of board (eq. raspberry PI).
A custom Arduino layer would always use 'software' SPI if there is no hardware support or try to use another SPI implementation.
Like the rest of the LedController v2+, it should be implemented as header only code, maybe even as singleton.
This Layer should be the only place that is depended on Hardware specific code.
In the future this layer may be used to allow more frameworks/boards to work with this library.
The header of this layer should define a generic interface, while the source files handle the platform specific implementation of that generic interface.
The library will not be portable from one platform to the next without recompiling but this makes a lot of code simpler
The features it needs to implement are the following:
Help with this appreciated.
byteBlock should be a class to allow it being a return type, reducing the need of C-style arguments (pointer to return location as argument).
version 1.7.2
In file included from LCDemo7Segment.ino:3:0: C:\Users\gunaon3\Documents\Arduino\libraries\LedController\src/LedController.hpp:9:7: error: expected nested-name-specifier before 'ByteBlock' using ByteBlock = byte[8]; ^ C:\Users\gunaon3\Documents\Arduino\libraries\LedController\src/LedController.hpp:9:7: error: 'ByteBlock' has not been declared C:\Users\gunaon3\Documents\Arduino\libraries\LedController\src/LedController.hpp:9:17: error: expected ';' before '=' token using ByteBlock = byte[8]; ^ C:\Users\gunaon3\Documents\Arduino\libraries\LedController\src/LedController.hpp:9:17: error: expected unqualified-id before '=' token In file included from C:\Users\gunaon3\Documents\Arduino\libraries\LedController\src/LedController.hpp:29:0, from LCDemo7Segment.ino:3: C:\Users\gunaon3\Documents\Arduino\libraries\LedController\src/LedController_config.hpp:74:30: error: 'nullptr' was not declared in this scope unsigned int *row_SPI_CS = nullptr; ^ C:\Users\gunaon3\Documents\Arduino\libraries\LedController\src/LedController_config.hpp: In static member function 'static bool controller_configuration::isValidConfig(const controller_configuration&)': C:\Users\gunaon3\Documents\Arduino\libraries\LedController\src/LedController_config.hpp:93:48: error: 'nullptr' was not declared in this scope if (conf.SPI_CS == 0 && conf.row_SPI_CS == nullptr) { ^ C:\Users\gunaon3\Documents\Arduino\libraries\LedController\src/LedController_config.hpp:98:28: error: 'nullptr' was not declared in this scope if (conf.row_SPI_CS != nullptr && ^ In file included from LCDemo7Segment.ino:3:0: C:\Users\gunaon3\Documents\Arduino\libraries\LedController\src/LedController.hpp: At global scope: C:\Users\gunaon3\Documents\Arduino\libraries\LedController\src/LedController.hpp:44:3: error: 'ByteBlock' does not name a type ByteBlock *LedStates = nullptr; ^ C:\Users\gunaon3\Documents\Arduino\libraries\LedController\src/LedController.hpp:198:52: error: 'ByteBlock' has not been declared void displayOnSegment(unsigned int segmentindex, ByteBlock data); ^ C:\Users\gunaon3\Documents\Arduino\libraries\LedController\src/LedController.hpp:206:50: error: 'ByteBlock' has not been declared void getSegmentData(unsigned int segmentindex, ByteBlock *resultLocation); ^ C:\Users\gunaon3\Documents\Arduino\libraries\LedController\src/LedController.hpp:444:20: error: 'ByteBlock' has not been declared void makeColumns(ByteBlock rowArray, ByteBlock *columnArray); ^ C:\Users\gunaon3\Documents\Arduino\libraries\LedController\src/LedController.hpp:444:40: error: 'ByteBlock' has not been declared void makeColumns(ByteBlock rowArray, ByteBlock *columnArray); ^ C:\Users\gunaon3\Documents\Arduino\libraries\LedController\src/LedController.hpp:452:16: error: 'ByteBlock' has not been declared void reverse(ByteBlock input, ByteBlock *reversedInput); ^ C:\Users\gunaon3\Documents\Arduino\libraries\LedController\src/LedController.hpp:452:33: error: 'ByteBlock' has not been declared void reverse(ByteBlock input, ByteBlock *reversedInput); ^ C:\Users\gunaon3\Documents\Arduino\libraries\LedController\src/LedController.hpp:460:18: error: 'ByteBlock' has not been declared void rotate180(ByteBlock input, ByteBlock *rotatedInput); ^ C:\Users\gunaon3\Documents\Arduino\libraries\LedController\src/LedController.hpp:460:35: error: 'ByteBlock' has not been declared void rotate180(ByteBlock input, ByteBlock *rotatedInput); ^ C:\Users\gunaon3\Documents\Arduino\libraries\LedController\src/LedController.hpp:62:19: error: 'nullptr' was not declared in this scope byte *spidata = nullptr; ^ C:\Users\gunaon3\Documents\Arduino\libraries\LedController\src/LedController.hpp:82:20: error: 'nullptr' was not declared in this scope byte *emptyRow = nullptr; ^ Multiple libraries were found for "SPI.h" Used: C:\Users\gunaon3\Documents\Arduino\libraries\SPI_master Not used: F:\APLIKASI\ELEKTRONIKA\ARDUINO\arduino-1.6.5-r5\hardware\arduino\avr\libraries\SPI Error compiling.
This looks like the best fork of this very popular but unmaintained library. It has everything I need except for the ability to set the maximum SPI transfer speed when configuring hardware SPI. (if your devices are on the end of a few metres of wire, or in a noisy environment, then interference becomes an issue). It's a trivial change - just add an optional spiSpeedMax parameter to init(), and if it's present, pass it to SPI.begin().
Another option is to allow the user to do the SPI.begin() themselves and pass it into a new function lc.init(&mySPI).
Thanks for the great work!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.