Mercurial > hg > beaglert
comparison include/Utilities.h @ 5:09f03ac40fcc
API improvements and cleanups. Now all common audio command-line options can be parsed automatically.
author | andrewm |
---|---|
date | Sat, 08 Nov 2014 16:16:55 +0100 |
parents | 8a575ba3ab52 |
children | 6adb088196a7 |
comparison
equal
deleted
inserted
replaced
4:f34c63568523 | 5:09f03ac40fcc |
---|---|
6 */ | 6 */ |
7 | 7 |
8 #ifndef UTILITIES_H_ | 8 #ifndef UTILITIES_H_ |
9 #define UTILITIES_H_ | 9 #define UTILITIES_H_ |
10 | 10 |
11 // Macros for accessing the matrix values: usable _only_ within render() | |
12 | |
13 // Read an analog input from input pin p at frame f | |
14 #define analogRead(p, f) (matrixIn[(f)*8 + (p)]) | |
15 // Write an analog output frame at output pin p, frame f, to value v | |
16 #define analogWrite(p, f, v) (matrixOut[(f)*8 + (p)] = (uint16_t)(v)) | |
17 | |
11 float map(float x, float in_min, float in_max, float out_min, float out_max); | 18 float map(float x, float in_min, float in_max, float out_min, float out_max); |
12 float constrain(float x, float min_val, float max_val); | 19 float constrain(float x, float min_val, float max_val); |
13 | 20 |
14 #endif /* UTILITIES_H_ */ | 21 #endif /* UTILITIES_H_ */ |