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 #226 background imageLoading...
Page #226 background image
that at the time of this writing, the IRremote library is able to decode remote
controls from Sanyo, Mitsubishi, and LG, but it doesnt support sending
commands to devices from these manufacturers.
After weve established the basis, we can implement all commands with a
single function call, so implementing
power
,
menu
,
play
, and so on is a piece of
cake.
Using the
TvRemote
class is easy, too. In the following sketch, we use it to
control a Samsung TV from the Arduinos serial monitor:
RemoteControl/TvRemote/TvRemote.ino
const unsigned int BAUD_RATE = 9600;
Line 1
-
TvRemote tv;
-
String command = "";
-
boolean input_available = false;
5
-
void setup() {
-
Serial.begin(BAUD_RATE);
-
}
-
10
void serialEvent() {
-
while (Serial.available()) {
-
const char c = Serial.read();
-
if (c == '\n')
-
input_available = true;
15
else
-
command += c;
-
}
-
}
-
20
void loop() {
-
if (input_available) {
-
Serial.print("Received command: ");
-
Serial.println(command);
-
if (command == "guide") tv.guide();
25
else if (command == "power") tv.power();
-
else if (command == "tools") tv.tools();
-
else if (command == "source") tv.source();
-
else if (command == "info") tv.info();
-
else if (command == "hdmi") tv.hdmi();
30
else if (command == "zero") tv.zero();
-
else if (command == "one") tv.one();
-
else if (command == "two") tv.two();
-
else if (command == "three") tv.three();
-
else if (command == "four") tv.four();
35
else if (command == "five") tv.five();
-
else if (command == "six") tv.six();
-
else if (command == "seven") tv.seven();
-
Chapter 12. Creating Your Own Universal Remote Control 210
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