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 #234 background imageLoading...
Page #234 background image
RemoteControl/InfraredProxy/infrared_proxy.cpp
void InfraredProxy::read_line(
EthernetClient& client, char* buffer, const int buffer_length)
{
int buffer_pos = 0;
while (client.available() && (buffer_pos < buffer_length - 1)) {
const char c = client.read();
if (c == '\n')
break;
if (c != '\r')
buffer[buffer_pos++] = c;
}
buffer[buffer_pos] = '\0';
}
read_line
reads one line of data sent by a client. A line ends either with a newline
character (\n) or with a carriage return character followed by a newline
character (\r\n).
read_line
expects the
EthernetClient
object to read data from, a
character buffer to store the data in (
buffer
), and the maximum length of the
character buffer (
buffer_length
). The method ignores all newline and carriage
return characters, and it sets the lines last character to \0 so the buffer to
be filled will always be a null-terminated string.
send_ir_data
is responsible for sending infrared commands:
RemoteControl/InfraredProxy/infrared_proxy.cpp
bool InfraredProxy::send_ir_data(
const char* protocol, const int bits, const long value)
{
bool result = true;
if (!strcasecmp(protocol, "NEC"))
_infrared_sender.sendNEC(value, bits);
else if (!strcasecmp(protocol, "SONY"))
_infrared_sender.sendSony(value, bits);
else if (!strcasecmp(protocol, "RC5"))
_infrared_sender.sendRC5(value, bits);
else if (!strcasecmp(protocol, "RC6"))
_infrared_sender.sendRC6(value, bits);
else if (!strcasecmp(protocol, "DISH"))
_infrared_sender.sendDISH(value, bits);
else if (!strcasecmp(protocol, "SHARP"))
_infrared_sender.sendSharp(value, bits);
else if (!strcasecmp(protocol, "JVC"))
_infrared_sender.sendJVC(value, bits, 0);
else if (!strcasecmp(protocol, "SAMSUNG"))
_infrared_sender.sendSAMSUNG(value, bits);
else
result = false;
return result;
}
Chapter 12. Creating Your Own Universal Remote Control 218
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