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 #153 background imageLoading...
Page #153 background image
Video/TvThermometer/TvThermometer.ino
#include <TVout.h>
#include <fontALL.h>
#include "thermometer.h"
const float SUPPLY_VOLTAGE = 5.0;
const float MIN_TEMP = 5.5;
const float MAX_TEMP = 40.0;
const unsigned int SCREEN_WIDTH = 120;
const unsigned int SCREEN_HEIGHT = 96;
const unsigned int TEMP_SENSOR_PIN = A0;
const unsigned int SCALE_X_MIN = 8;
const unsigned int SCALE_Y_MIN = 6;
const unsigned int SCALE_Y_MAX = 75;
const unsigned int SCALE_WIDTH = 3;
const unsigned int SCALE_HEIGHT = SCALE_Y_MAX - SCALE_Y_MIN;
float current_temperature = 0.0;
unsigned long last_measurement = millis();
TVout TV;
At the beginning of our program, we include a few header files.
TVout.h
declares
TVouts main class and all of its methods.
fontALL.h
contains the definition of
all fonts that TVout offers. If you dont want to output any text, you dont
have to include it. The
thermometer.h
file makes the graphical representation of
our thermometer available to our program. Ill explain its content later.
After weve included all necessary header files, we define a few constants and
variables:
SUPPLY_VOLTAGE
defines the Arduinos supply voltage, and
TEMP_SENSOR_PIN
contains the number of the pin to which youve connected the TMP36
sensor.
MIN_TEMP
and
MAX_TEMP
define the minimum and maximum temperatures
(in degrees Celsius) that the TV thermometer can display.
SCREEN_WIDTH
and
SCREEN_HEIGHT
define the screens width and height. Note
that the Arduino isnt capable of displaying really big screen resolutions.
A width of 120 to 132 pixels and a height of 96 pixels is a reasonable
compromise.
SCALE_X_MIN
defines the minimum X position of the thermometers scale.
SCALE_Y_MIN
and
SCALE_Y_MAX
define the minimum and maximum Y positions
of the thermometers scale. Well need these constants to draw a rectangle
representing the current temperature later.
Chapter 8. Generating Video Signals with an Arduino 136
report erratum discuss
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