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 #154 background imageLoading...
Page #154 background image
SCALE_WIDTH
and
SCALE_HEIGHT
define the width and height of the thermome-
ters scale.
The variable
current_temperature
holds the last temperature we measured.
last_measurement
contains the time stamp in milliseconds when we last
measured the current temperature. We need this because we dont want
to measure the temperature permanently, but only every few seconds.
TV
is an instance of the
TVout
class, and well use it for accessing the TV
screen using the Arduino.
Next we define the
setup
function:
Video/TvThermometer/TvThermometer.ino
void setup() {
TV.begin(PAL, SCREEN_WIDTH, SCREEN_HEIGHT);
TV.bitmap(0, 1, thermometer);
TV.select_font(font4x6);
TV.set_cursor(20, 4);
TV.print("40");
TV.set_cursor(20, 24);
TV.print("30");
TV.set_cursor(20, 44);
TV.print("20");
TV.set_cursor(20, 64);
TV.print("10");
}
We call the
begin
method of the
TV
object. We set the analog TV standard to
PAL, and we set the screens width and height. If your TV set prefers NTSC,
you have to replace the first argument with
NTSC
. After that, we invoke the
bitmap
method to draw the thermometer image to the screen. Its X position is
0, and its Y position is 1.
The thermometers image doesnt contain numbers next to its scale, so we
add the numbers in our program. Therefore, we have to select the font were
going to use by using the
select_font
method. TVouts font capabilities are quite
impressive. It comes with three fixed-width fonts (4x6, 6x8, and 8x8 pixels)
that are sufficient for most purposes. It also supports variable-width fonts,
and it even allows you to define your own. Here we use a font thats 4 pixels
wide and 6 pixels high. The
set_cursor
method moves the cursor to a certain
screen position, and
print
prints text to the current cursor position.
The
loop
function implements the rest of our thermometers business logic.
report erratum discuss
Building a TV Thermometer 137
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