30
Create unsigned char array. Its prototype is: Array name[].Arrays are a form of programming that
organizes a set of elements of the same type in an unordered form for ease of processing. Unsigned
char is an unsigned byte type. The size of a char type variable is usually 1 byte and it is an integer.
Here we create three unsigned char arrays to store the data we want to send.
Array: unsigned char LED1[] = {15, 70, 70, 20, 60, 5, 1, 0, 0, 0,0};
“IR.Send(Parameter1, Parameter2)” is an infrared send data function built-in the IR library. The
parameter1 is the data we want to send and parameter2 is the frequency we send this data. You may
confuse why IR emitter is connected to D3 port(pin3), that is because the D3 port is the PWM output
port.
Send data: IR.Send(LED1, 38); IR.Send(LED2, 38); IR.Send(OFF, 38);
“IR.init()” is the initialize function of the IR receiver. Before we receiver the data sent by the emitter,
we have to initialize the IR receiver to tell which pin to obtain the data. Therefore, we need to enter
the pin of the receiver in the parentheses.
IR Receiver initialize: IR.Init(IR_Receiver);
“IR.Recv()” is the IR receive function of IR receiver that built-in the IR library. The parameter in
parentheses is the address where the data is stored after the receiver receives the data. Here we
store the data in the “dta” array we created.
Receive data: IR.Recv(dta);
Arduino Uno/Crowduino Uno x1
Crowtail - Motor Base Shield x1
Crowtail - I2C EEPROM x1
Crowtail - Cable x1
Required Parts
If you need to do some data storage in Arduino but found that the
EEPROM in ATmega chip too limited, then this Crowtail-I2C EEPROM
is your best choice. This module is based on the EEPROM chip
AT24C256, which has 256k bit capacity. It communicates with Arduino
with the I2C bus, helps you do much more data storage easily.
In this lesson, we will learn how to use it as a memory, store some data
in it and read it out.
Lesson 14 – Store data
Introduction
Summary of Contents for Crowtail Deluxe Kit
Page 47: ......