EasyManuals Logo

Arduino uno User Manual

Arduino uno
311 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #156 background imageLoading...
Page #156 background image
Next, we output the current temperature as text. We use TVouts
select_font
,
set_cursor
, and
print
methods to output the text Current Temperature in a font
that is 6 pixels wide and 8 pixels high. After that, we output the current
temperature in degrees Celsius using the 8x8 font. The TVout library doesnt
define a symbol for degrees Celsius, so we use the
draw_circle
method in line
21 to draw a small circle to simulate a degrees symbol.
Were done! Thats all the code we need to make the TV thermometer work.
The only thing I havent explained in detail is how outputting the thermometer
image works. Youll learn more about that in the next section.
Working with Graphics in TVout
In
TvThermometer.ino
weve included the
thermometer.h
file without explaining what
it contains. Heres how it looks:
Video/TvThermometer/thermometer.h
#ifndef THERMOMETER_H
#define THERMOMETER_H
extern const unsigned char thermometer[];
#endif
Quite disappointing, isnt 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
(weve skipped a
few lines for brevity):
Video/TvThermometer/thermometer.cpp
#include <Arduino.h>
Line 1
#include <avr/pgmspace.h>
-
#include "thermometer.h"
-
PROGMEM const unsigned char thermometer[] = {
-
20, 94,
5
B00000000, B11110000, B00000000,
-
B00000001, B00001000, B00000000,
-
B00000010, B00000100, B00000000,
-
B00000010, B00000100, B00000000,
-
B00000010, B00000100, B00000000,
10
B00000010, B00000111, B10000000, // 40.0
-
B00000010, B00000100, B00000000,
-
B00000010, B00000100, B00000000,
-
B00000010, B00000100, B00000000,
-
B00000010, B00000100, B00000000,
15
B00000010, B00000100, B00000000,
-
report erratum discuss
Working with Graphics in TVout 139
www.it-ebooks.info

Table of Contents

Other manuals for Arduino uno

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Arduino uno and is the answer not in the manual?

Arduino uno Specifications

General IconGeneral
Form factorArduino
CertificationRoHS, FC, CE
Processor model-
Processor frequency- MHz
Microcontroller modelATmega328
Microcontroller frequency16 MHz
DC input voltage7-12 V
Operating voltage5 V
DC current per I/O pin40 mA
Flash memory0.032 MB
Maximum internal memory- GB
SRAM (Static Random Access Memory)2 KB
EEPROM (Electrically Erasable Programmable Read-Only Memory)1 KB
Wi-FiNo
Number of analog I/O pins6
Number of digital I/O pins14
Weight and Dimensions IconWeight and Dimensions
Board dimensions53.4 x 68.6 mm

Related product manuals