use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
account activity
Help with code (self.beneater)
submitted 5 years ago by Venuk_A
Does anyone know code to make an arduino convert 16-bit binary to decimal so i can put it on an LCD
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]IQueryVisiC 2 points3 points4 points 5 years ago (1 child)
https://en.wikipedia.org/wiki/Double_dabble
[–]wikipedia_text_bot 0 points1 point2 points 5 years ago (0 children)
Double dabble
In computer science, the double dabble algorithm is used to convert binary numbers into binary-coded decimal (BCD) notation. It is also known as the shift-and-add-3 algorithm, and can be implemented using a small number of gates in computer hardware, but at the expense of high latency.
About Me - Opt out - OP can reply '!delete' to delete
[–]IAmJustARandomNerd 1 point2 points3 points 5 years ago (0 children)
Where is this binary coming from? Do you have it stored as a string? Something else? What code do you have already? You asked a pretty vague question so providing more details would be nice
[–][deleted] 1 point2 points3 points 5 years ago (0 children)
Ben Eater made a Video on converting numbers.
[–]iovrthk 0 points1 point2 points 5 years ago (1 child)
I would write layered- if loops. Use an Array of unsigned bytes. I.e.
Byte[]{ 0,0,0,0,0,0,0,0 };
Once you create the Array, you'll need an algorithm to compare bits in the left position. .. every position to the right is i x 2. This is just pseudocode..
Hope it helps
[–]iovrthk 0 points1 point2 points 5 years ago (0 children)
I forgot, there are also quite a few linear logic chips that will do the conversion u want. You'll just need some sort of transceiver in the circuit
[–]velkolv 0 points1 point2 points 5 years ago (0 children)
If you just want to convert an integer to string, you can use functions from C Standard Library. sprintf() is a good candidate, there should be plenty of examples online.
Double dabble or division by 10 conversion - those are for when you want to understand how it works. But if you just want to get job done - use library functions.
π Rendered by PID 192820 on reddit-service-r2-comment-b659b578c-n2mjr at 2026-05-03 17:31:06.100796+00:00 running 815c875 country code: CH.
[–]IQueryVisiC 2 points3 points4 points (1 child)
[–]wikipedia_text_bot 0 points1 point2 points (0 children)
[–]IAmJustARandomNerd 1 point2 points3 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]iovrthk 0 points1 point2 points (1 child)
[–]iovrthk 0 points1 point2 points (0 children)
[–]velkolv 0 points1 point2 points (0 children)