Mercurial > hg > beaglert
comparison include/Utilities.h @ 7:ab396a08e962
Merge
author | Victor Zappi <victor.zappi@qmul.ac.uk> |
---|---|
date | Tue, 11 Nov 2014 15:31:01 +0000 |
parents | 09f03ac40fcc |
children | 6adb088196a7 |
comparison
equal
deleted
inserted
replaced
6:db025ec86c41 | 7:ab396a08e962 |
---|---|
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_ */ |