Working with Graphics in TVout
In TvThermometer.ino we’ve included the thermometer.h file without explaining what it contains. Here’s how it looks:
Video/TvThermometer/thermometer.h | |
| #ifndef THERMOMETER_H |
| #define THERMOMETER_H |
| extern const unsigned char thermometer[]; |
| #endif |
Quite disappointing, isn’t it? The file declares only a single variable named thermometer. This variable is an array of unsigned character values, and the extern keyword tells the compiler that we only want to declare the variable. That is, we can refer to it in our program, but we still have to define it to allocate some memory.
We actually define the thermometer variable in thermometer.cpp (we’ve skipped a few lines for brevity):
Video/TvThermometer/thermometer.cpp ... |
Get Arduino: A Quick-Start Guide, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.