-
-
Notifications
You must be signed in to change notification settings - Fork 1
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
7 segment display - 6 digits #1
Comments
Thank you for using my library and reporting issue. Rearranging output digits is not supported currently. The modified code will be like below. (not tested with actual display modules) if (NUM_OF_GRIDS_FOR_USE <= grid)
return; // out of range
//m_segmentBits[grid] = segmentBits; /* current code. we have to change this. */
// rearrange specified 'grid' to actual display's one
unsigned int rearrangedGrid = 0
switch (grid) {
case 0: rearrangedGrid = 2; // 1 -> 3
case 1: rearrangedGrid = 1; // 2 -> 2
case 2: rearrangedGrid = 0; // 3 -> 1
case 3: rearrangedGrid = 5; // 4 -> 6
case 4: rearrangedGrid = 4; // 5 -> 5
case 5: rearrangedGrid = 3; // 6 -> 4
}
m_segmentBits[rearrangedGrid] = segmentBits; // set data bits to display's digit The codes that will need to be fixed are here.
I thing it is required feature to rearrange output digit, so I would like to add some functions to do that. |
Thanks for the fast reply! I will try and give this a go modifying your library :) Will report back hopefully in a few days to see if I got it working or not :) |
Added modification for rearranging output digits. (see #2) /* current code */
auto display = TM1637_7SegmentLEDController<6>(
PIN_DIO,
PIN_CLK
);
/* modified code */
auto display = TM1637_7SegmentLEDController<6>(
PIN_DIO,
PIN_CLK,
{2, 1, 0, 5, 4, 3} // <-- specify display module's digit order here
); If there's no problems, I will merge this to main branch and release it. |
hot dang! that was so quick. I was still trying to merge your example. Thanks I will try this right now. |
Just tried it with your basic example in example folders and it worked perfectly. Can now rearrange with ease and displays the correct output of what is to be expected in the example. You can merge it. One last question is there a way to display a degree symbol? |
Thank you for fast reporting!
Sorry for wasting your work😥
You can do it like this. // sets numbers and 'F' sign of ℉
display.displayNumericalString("12.34 F", false);
// ^- place holder for degree sign
//
// ('false' means write to internal buffer only, does not light up immediately)
// sets degree sign of ℉ on 5th digit and light them up
display.setSegmentBitsAt(4, 0b01100011);
// /|||||||
// bit for segment: DP GFEDCBA
// 0: light off 1: light on
// Then display shows like "12.34°F" |
ahh yes I missed that. I was going to guess you had a manual segment call somewhere. Thanks. Stay awesome 👍 |
I found regression in PR #2. So it takes some more times to fix it and release. Sorry😣 |
Released v1.1.0, sorry to keep you waiting. Thank you for your reporting and helping!😄 |
hello. I have used one of your examples in your source and I have problems with the display. Everything is hooked up
When I do a write to the display it will display it wrong. For example I have a 6 digit 7 segment display
when I do a display.display((int32_t)123456); After flashing it will display 321654.
if I do a display of display.display((int32_t)321654); After flashing it will display 123456
same with anything I put in, doesn't have to be just digits
This is the display I have, clearly they have wired it up differently than what you're library is expecting
https://www.aliexpress.com/item/4001286892567.html?spm=a2g0o.productlist.0.0.6c88d123AoF4eu&algo_pvid=308db7c9-2fcd-4e33-bf3c-d85a9a2e4365&algo_expid=308db7c9-2fcd-4e33-bf3c-d85a9a2e4365-7&btsid=2100bdd516072143080114867e3c5d&ws_ab_test=searchweb0_0,searchweb201602_,searchweb201603_
What I was going to do is go into yoru library and rearrange the way it outputs the digits as I did that on another tm1637 library. However this one is soooo much more complicated that I don't know where to start.
I would like to use this library because it supports everything I need, strings, digits, "-" and "." some only support digits or strings with no "." or "-"
The text was updated successfully, but these errors were encountered: