I want to input DEC integers by keyboard into serial monitor , and receive an output of that integer in binary onto 8 LEDs.
Ex. input by keyboard is 10010001
LED output is OXXOXXXO,10010001
I want to input DEC integers by keyboard into serial monitor , and receive an output of that integer in binary onto 8 LEDs.
Ex. input by keyboard is 10010001
LED output is OXXOXXXO,10010001
Odd thing to want to do but you build up the number one digit at a time. It comes in from the keyboard as ASCII, so you convert that into a decimal number by ANDing the received serial character with 15.
Then you add it to an accumulator variable. Before you add a new value you multiply the old value by ten.
There is no need to convert this accumulated value into binary as all variables are stored in the computer as binary.
So type something in and click on "send".
I hope you're not trying to send it to the sketch in the picture.
I'll let you. ![]()
Seriously, though, you'll need a bit more code than is shown in your screenshot.
Take a look at Serial Input Basics - updated and also the examples in the IDE:- ">File >Examples >Communication"
*And what AWOL said. ![]()
Meaningless title and minimal information that we are expected to interpret and give a helpful answer?
Please try harder next time.
Weedpharma
Perhaps you should have just continued with your original thread rather than start a new one.
(At least you gave more information in your previous thread.)
From Integer by Keyboard to LED binary 8bits