New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] support for HT1632C LED control #1006
Conversation
lib/led/ledcontrol.js
Outdated
} | ||
this.io.digitalWrite(this.pins["write"], 1); | ||
} | ||
this.io.pinMode(this.pins["data"], this.io.MODES.INPUT); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For all occurrences, just use dot access: this.pins["write"]
=> this.pins.write
d729cf1
to
90b49a4
Compare
90b49a4
to
552e5d4
Compare
Thanks for the feedback @rwaldron, I've fixed up accordingly. Most API functionality has parity with the other matrices. Here's some example code that would work with an var five = require("johnny-five");
var board = new five.Board();
board.on("ready", function() {
var matrix = new five.Led.Matrix({
controller: "HT1632C",
pins: {
data: 2,
write: 3,
cs: 4
},
devices: 1,
dims: {
rows: 16,
columns: 24
}
});
matrix.led( 0, 0, true );
matrix.led( 15, 23, true );
matrix.writeDisplay();
matrix.blink();
matrix.brightness(0);
// Maximum brightness.
matrix.brightness(15);
matrix.draw( "hi" );
matrix.brightness(0);
matrix.writeDisplay();
}); Some open questions: Writing to the display seems expensive at the moment, so I've disabled How would one expect The HT16K33 supports bicolor displays. Are there bicolor HT1632C matrices? The HT16K33 supports rotation. Should the HT1632C do this as well? Any other feedback appreciated. |
This is a semantic deviation that definitely needs to be resolved, but I have a feeling that won't be possible considering...
Based on the communication protocol requirements, I assumed it would be. It's not much different from the MAX7219 and MAX722 devices, which are written using
I honestly have no idea. This display breaks a lot of assumptions made by existing LED matrix component controller implementations鈥攖hat Johnny-Five just followed because that seemed to be a smart thing to do. Part of me wishes Johnny-Five could offload some of this stuff into plugins like the totally excellent node-pixel, but that ship has probably sailed :\ Let's gather some other brains that have worked on plugin stuff and/or led component stuff... The thing I'd like to think about and discuss: building a set of LED component (digit, matrix, bar graph) classes as a plugin similar to node-pixel. I think this would be a way to expand the capabilities in a smart way and most importantly starting clean. @dtex and @BrianGenisio are brilliant at identifying capability intersection. |
what was the other issue I was talking about this in? Had something to do with bar graphs... |
I think it's worth mentioning that due to the nature of these displays, an inheritance model might be inappropriate. If we define individual capabilities such as "bi-color" or "matrix" and compose resulting objects that way, we won't fall into the trap of trying to classify hardware too hard or violate assumptions. I'm not sure a pairing of a public API and a controller object makes much sense though. You can't necessarily use any combination. Maybe the public API should be hardware-specific. I know this goes contrary to much of j5's API but it's worth discussing. The current abstraction for these displays leaks everywhere.... |
(that ticket was #665) |
also, please let me know if the above comment(s) didn't make sense; I wrote them while half-awake |
#665 is a nice read :) We could do a refactor there. After that adding support here should be nominal. (Famous last words...) I'm going to leave this open for now and see if I can help out on that ticket. |
e8229a0
to
16d0aac
Compare
7e94449
to
aaee114
Compare
beb9597
to
4357638
Compare
7d6e95a
to
935fd36
Compare
Hi @ericandrewlewis , Since this has been open and on hold for a while I'm closing. Rather than leave it languishing as an open PR we have created a Requested Features page and I have added your request for the HT1632C there with links to this PR and the relevant issue. |
This is a work in progress PR for #1000. More or less a JS port of Adafruit's HT1632C library.
Feedback welcome 馃槃 More soon.