Hardware Reference
In-Depth Information
Step 2: An overview of Arduino board program
The Arduino software is used to write a program for the Arduino mega2560. Now
we're going to explain the written program. Any of you can see the program source file in
attendant CD.
As you are now in in the first part of the program, the needed libraries should be inser-
ted. MFRC522.h library is inserted to the program to use RFID_RC522 card. Then this
card should be configured by the following instruction.
MFRC522 mfrc522(SS_PIN, RST_PIN);
In addition, the LiquidCrystal.h library is inserted to use the LCD. The next program
code configures it in the program.
LiquidCrystal lcd(42, 43, 44, 45, 46, 47);
The DS1307 IC generates exact time in the circuit. It has been connected to Arduino
board with I2C protocol. In our program to setup and computing time, two Wire.h and
DS1307rtc.h libraries are inserted to the program. The following instruction is a typical
command to generate time and date that will be used during the program.
tmElements_t mytm;
To have a better program, some symbols are defined for input and output pins of the
Arduino board.
Inputs Symbols
Paid
Paid button
Setpb
The Key to modify time
input_sensor
The sensor that it detects car
input_up_ms
Gate input upper limit limit switch
input_down_ms
Gate input lower limit limit switch
Search WWH ::




Custom Search