From 620a534e46a78e2664f1a105c694330fc267453b Mon Sep 17 00:00:00 2001 From: Jonas Gunz Date: Fri, 3 May 2019 03:07:07 +0200 Subject: Did a fuck ton. --- character.c | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 character.c (limited to 'character.c') diff --git a/character.c b/character.c new file mode 100644 index 0000000..658f0be --- /dev/null +++ b/character.c @@ -0,0 +1,10 @@ +#include "character.h" + +const char character_luminance_map [] = {' ', ' ', '.', ',', '`', '-', '~', '"', '*', ':', ';', '<', '!', '/', '?', '%', '&', '=', '$', '#'}; +//const char map[] = {' ', '`', '.', ',', ':', ';', '\"', '+', '#', '@'}; + +char calc_char(uint8_t _c , uint8_t _min, uint8_t _max) +{ + float c = (float)(_c) / (_max - _min); + return character_luminance_map [(int)((sizeof(character_luminance_map)-1) * (c))]; +} -- cgit v1.2.3