Hello,
To start of i want to say that i have basic knowledge in terms of electric/magnetic phenomena. I'm am now learning more about electronics.
I am struggling to understand how the binary numbers can be different bit-values. I'm at this moment programming with the arduino board in my class, and the simple project i am working on is to make a led-light dim, in other words make it have a fade effect. It's quite easy, but to explain my "problem":
Brightness is the integer for the light emitted, and has value between 0-255. The fade-amount integer is set to jump in steps of 5. So as the fade goes up or down, it happens with 5´s between 0-255. The range of 0-255 is what i want to understand. I know the arduino board is an 8-bit microcontroller, and a byte can represent a decimal value of maximum 255, hence the range. Then looking into it, it would mean that different 1's will have different values in them selves, at least when you look at the binary table.
For example the 1st binary 1, would represent decimal value 1, while the 8th binary 1 would represent decimal value 128. So dependent on what value the microcontroller is suppose to send on the output, it will choose between which 1's will be "on"?
Lets say i want 128/255 on the output, the binary would be set to: 10000000.
But if i want 1/255 on the output, the binary would be set to: 00000001.
So the are still just one binary 1 in each code, but obviously they are not by the same value. In this case, what determines these values for the different binary numbers? Yes i want to know the reality of these electrical signals, and how they can vary. My first thought is that they represent different voltage levels, if so, it is then determined by the electric connections in an IC?
I have also read a little about logic gates, registers etc. But not too much.
Appreciate any answers, Thanks.
To start of i want to say that i have basic knowledge in terms of electric/magnetic phenomena. I'm am now learning more about electronics.
I am struggling to understand how the binary numbers can be different bit-values. I'm at this moment programming with the arduino board in my class, and the simple project i am working on is to make a led-light dim, in other words make it have a fade effect. It's quite easy, but to explain my "problem":
Brightness is the integer for the light emitted, and has value between 0-255. The fade-amount integer is set to jump in steps of 5. So as the fade goes up or down, it happens with 5´s between 0-255. The range of 0-255 is what i want to understand. I know the arduino board is an 8-bit microcontroller, and a byte can represent a decimal value of maximum 255, hence the range. Then looking into it, it would mean that different 1's will have different values in them selves, at least when you look at the binary table.
For example the 1st binary 1, would represent decimal value 1, while the 8th binary 1 would represent decimal value 128. So dependent on what value the microcontroller is suppose to send on the output, it will choose between which 1's will be "on"?
Lets say i want 128/255 on the output, the binary would be set to: 10000000.
But if i want 1/255 on the output, the binary would be set to: 00000001.
So the are still just one binary 1 in each code, but obviously they are not by the same value. In this case, what determines these values for the different binary numbers? Yes i want to know the reality of these electrical signals, and how they can vary. My first thought is that they represent different voltage levels, if so, it is then determined by the electric connections in an IC?
I have also read a little about logic gates, registers etc. But not too much.
Appreciate any answers, Thanks.