-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 0.1.2 add RGB565 16 bit + some refactor
- Loading branch information
1 parent
47f6c21
commit e74767d
Showing
8 changed files
with
178 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
examples/Kelvin2RGB565_diff_hex/Kelvin2RGB565_diff_hex.ino
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// | ||
// FILE: Kelvin2RGB565_diff_hex.ino | ||
// AUTHOR: Rob Tillaart | ||
// VERSION: 0.1.2 | ||
// PURPOSE: demo - shows difference between 2 convert functions for the 565 16 bit coding | ||
// DATE: 2021-06-01 | ||
// URL: https://github.com/RobTillaart/Kelvin2RGB | ||
// | ||
|
||
// shows difference between the two calculations | ||
// best viewed in plotter. | ||
|
||
#include "Kelvin2RGB.h" | ||
|
||
Kelvin2RGB KRGB; | ||
Kelvin2RGB KRGB2; | ||
|
||
void setup() | ||
{ | ||
Serial.begin(115200); | ||
Serial.println(__FILE__); | ||
|
||
KRGB.begin(); | ||
KRGB2.begin(); | ||
|
||
test_difference(); | ||
} | ||
|
||
void loop() | ||
{ | ||
} | ||
|
||
void test_difference() | ||
{ | ||
float bright = 100.0; | ||
for (uint32_t temp = 0; temp < 70000; temp += 200) | ||
{ | ||
KRGB.convert_TH(temp, bright); | ||
KRGB2.convert_NB(temp, bright); | ||
|
||
Serial.print(KRGB.RGB565(), HEX); | ||
Serial.print("\t"); | ||
Serial.print(KRGB2.RGB565(), HEX); | ||
Serial.print("\n"); | ||
} | ||
} | ||
|
||
// -- END OF FILE -- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// | ||
// FILE: Kelvin2RGB_diff_hex.ino | ||
// AUTHOR: Rob Tillaart | ||
// VERSION: 0.1.2 | ||
// PURPOSE: demo - shows difference between 2 convert functions for the 565 16 bit coding | ||
// DATE: 2021-06-01 | ||
// URL: https://github.com/RobTillaart/Kelvin2RGB | ||
// | ||
|
||
// shows difference between the two calculations | ||
// best viewed in plotter. | ||
|
||
#include "Kelvin2RGB.h" | ||
|
||
Kelvin2RGB KRGB; | ||
Kelvin2RGB KRGB2; | ||
|
||
void setup() | ||
{ | ||
Serial.begin(115200); | ||
Serial.println(__FILE__); | ||
|
||
KRGB.begin(); | ||
KRGB2.begin(); | ||
|
||
test_difference(); | ||
} | ||
|
||
void loop() | ||
{ | ||
} | ||
|
||
void test_difference() | ||
{ | ||
float bright = 100.0; | ||
for (uint32_t temp = 0; temp < 70000; temp += 200) | ||
{ | ||
KRGB.convert_TH(temp, bright); | ||
KRGB2.convert_NB(temp, bright); | ||
|
||
Serial.print(KRGB.RGB(), HEX); | ||
Serial.print("\t"); | ||
Serial.print(KRGB2.RGB(), HEX); | ||
Serial.print("\n"); | ||
} | ||
} | ||
|
||
// -- END OF FILE -- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ red KEYWORD2 | |
green KEYWORD2 | ||
blue KEYWORD2 | ||
RGB KEYWORD2 | ||
RGB565 KEYWORD2 | ||
|
||
# Constants (LITERAL1) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters