aboutsummaryrefslogtreecommitdiff
path: root/src/character.c
blob: 8a42370df313f4a1619e9d484bab150974eb6cc5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#include "character.h"

const char *default_character_map="  .,-~\"*:;<!/?%&=$#";
//const char *default_character_map=" `.,:;/+#@";

char calc_char(uint8_t _c , uint8_t _min, uint8_t _max, char *_custom_map)
{
	const char *map = _custom_map == 0 ? default_character_map : _custom_map;

	float c = (float)(_c) / (_max - _min);
	return map [(int)( strlen( map ) * (c))];
}