MCPcopy Create free account
hub / github.com/RobTillaart/Arduino / calculateWaveLengthFactor

Method calculateWaveLengthFactor

libraries/TSL235R/TSL235R .cpp:64–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62
63
64float TSL235R::calculateWaveLengthFactor(uint16_t _waveLength)
65{
66 // figure 2 datasheet
67 // 635 nm is reference 1.000
68 // remaining is linear interpolated between points in the graph
69 float in[] = { 300, 350, 400, 500, 600, 635, 700, 750, 800, 850, 900, 1000, 1100};
70 float out[] = { 0.1, 0.35, 0.5, 0.75, 0.93, 1.00, 1.15, 1.20, 1.15, 1.10, 0.95, 0.40, 0.10};
71 return 1.0 / multiMap(_waveLength, in, out, 13);
72}
73
74
75float TSL235R::multiMap(float value, float * _in, float * _out, uint8_t size)

Callers

nothing calls this directly

Calls 1

multiMapFunction · 0.85

Tested by

no test coverage detected