greetings,
I want a piece of code that looks like "0x1F" to be sent to 8 different output pins, each representing a place in the binary number that "0x1F" is presumed to represent.
to rephrase for clarity,
I want to make a physical 'copy' of a binary value manifest itself in the electrical charge state of 8 (digital) pins, so if i had 8 LEDs, they would light up and represent the binary value of whatever 8 bit hex number was fed into it.
I don't want to use the port feature or any of that, i want to just build the code from scratch, like one wire going to the next wire, but i need to build a little process that accepts a hex value and emits a binary number, and another process to divide that binary number into 8 pieces, and assigns them one at a time to a respective output pin on the Teensy 3.1. I will assign them arbitrarily to any sequence of digital pins I choose, I will not subscribe to the superstition that they need to be wired in special order to do simple things like turn on and off leds for example.
i want to ignore weird things like ports and such. i want to understand this before i rely on other code that creates compounding obscurity at my skill level. i need to understand one thing before i can understand the next thing, i can't keep on replacing variables with other variables.
so, to reiterate, a hex value that looks like "0xF1" i want to convert to its full 8 bit binary equivalent in zeroes and ones, chop those zeroes and ones into 8 pieces, and send each piece in order, to deliver electrical charges on a Teensy's output pins.
I hope this was a good explanation of my problem of which i have no solution.
I want a piece of code that looks like "0x1F" to be sent to 8 different output pins, each representing a place in the binary number that "0x1F" is presumed to represent.
to rephrase for clarity,
I want to make a physical 'copy' of a binary value manifest itself in the electrical charge state of 8 (digital) pins, so if i had 8 LEDs, they would light up and represent the binary value of whatever 8 bit hex number was fed into it.
I don't want to use the port feature or any of that, i want to just build the code from scratch, like one wire going to the next wire, but i need to build a little process that accepts a hex value and emits a binary number, and another process to divide that binary number into 8 pieces, and assigns them one at a time to a respective output pin on the Teensy 3.1. I will assign them arbitrarily to any sequence of digital pins I choose, I will not subscribe to the superstition that they need to be wired in special order to do simple things like turn on and off leds for example.
i want to ignore weird things like ports and such. i want to understand this before i rely on other code that creates compounding obscurity at my skill level. i need to understand one thing before i can understand the next thing, i can't keep on replacing variables with other variables.
so, to reiterate, a hex value that looks like "0xF1" i want to convert to its full 8 bit binary equivalent in zeroes and ones, chop those zeroes and ones into 8 pieces, and send each piece in order, to deliver electrical charges on a Teensy's output pins.
I hope this was a good explanation of my problem of which i have no solution.
Last edited: