WR Home Topic Home | Chapter: 1 2 3 4 5 6 7 8 9 |
<Previous | Next> |
Chapter 09
Using the Remote-Control to change the "Color Map"
Page 1
Color Map Basics
What is a Color-Map ?
There are THREE bits representing the blue green red colors
In the file render.c, the variable bytePORTC, has these THREE bits at the positions 5, 4, 3 containing the values for blue green red colors respectively.
Three BITs & Three PINs
So the three bits 5,4,3 of bytePORTC are logically connected to PC5, PC4, PC3
But these three bits can be connected to (or MAPPED to) the three pins in six ways !
Like this:
Or in C-language it can be written as:-
// Connect R G B with r g b : Default case: True mapping: As user mentioned in GUI R_PC3=colorBit_r; G_PC4=colorBit_g; B_PC5=colorBit_b; // Swap R G B with b r g R_PC3=colorBit_b; G_PC4=colorBit_r; B_PC5=colorBit_g; // Swap R G B with g b r R_PC3=colorBit_g; G_PC4=colorBit_b; B_PC5=colorBit_r; // Swap R G B with r b g R_PC3=colorBit_r; G_PC4=colorBit_b; B_PC5=colorBit_g; // Swap R G B with b g r R_PC3=colorBit_b; G_PC4=colorBit_g; B_PC5=colorBit_r; // Swap R G B with g r b R_PC3=colorBit_g; G_PC4=colorBit_r; B_PC5=colorBit_b;
WR Home Topic Home | Chapter: 1 2 3 4 5 6 7 8 9 |
<Previous | Next> |