Editing
Charlieplexing as a basis function
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==== Charlieplexed pins have a ternary encoding ==== Note that every pin in a charlieplexed array is a trit, it has 3 possible states: HIGH, LOW, and HI-Z. So, we can encode all possible states of our pins as a 6-trit number. This gives us 729 possible states, which are pretty easy to enumerate: you just count to 729! Then, you take this number modulo 3, and that gives you the first trit's value: 0, 1, or 2. 0 is HI-Z, 1 is LOW, and 2 is HIGH. You then divide the number by 3 (right shift in base 3), and take the modulus to get the second trit. Rinse, repeat, to get 6 trits. This gives you a set of six pin states. These can be applied on the microcontroller itself to actually drive the pins, or used in a modelling program. In fact, that's exactly what we do: we take a model of the LED pinout (ie: to turn on LED 1, turn pin 1 HIGH and pin 2 LOW) and check it against the pin states above. When we do this, we find that we can associate each of our 729 pin states with a set of LEDs that turn on. For example, TK state 106 turns on LEDs 1, 3, 12, and 15. To turn on just pin 2, we'd use state 11, which only turns on LED 2. We can thus encode the display of LEDs 1, 2, 3, 12, and 15 as { 106, 11 }. Before, we'd have to turn on all 5 LEDs individually, which meant that each LED could be at most 1/5 its total brightness. Now, we can do it in just two operations, letting each one be roughly half its peak brightness. Reducing the operations also reduces the problem with flicker, as there's not as much delay between the updates.
Summary:
Please note that all contributions to Noisebridge are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
Noisebridge:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
To protect the wiki against automated edit spam, we kindly ask you to solve the following CAPTCHA:
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Log in
Request account
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Dig in!
Noisebridge
- Status: MOVED
- Donate
- ABOUT
- Accessibility
- Vision
- Blog
Manual
MANUAL
Visitors
Participation
Community Standards
Channels
Operations
Events
EVENTS
Guilds
GUILDS
- Meta
- Electronics
- Fabrication
- Games
- Music
- Library
- Neuro
- Philosophy
- Funding
- Art
- Crypto
- Documentation/Wiki
Wiki
Recent Changes
Random Page
Help
Categories
(Edit)
Tools
What links here
Related changes
Special pages
Page information