Hardware Reference
In-Depth Information
Reading from Mifare Tags
To prepare for the next part of this project, use the
previous Processing sketch to write Twitter handles to a
few tags in this format:
When you're sure you've got a couple tags with Twitter
handles on them, you're ready to build the next part of the
project: an Arduino tweet reader.
Circuit Additions
The circuit is the same as in Figures 9-14 and 9-15, but
with an Ethernet connection and a 2x16 LCD attached. If
you're already using an Arduino Ethernet, you're all set.
If not, add an Ethernet shield. Either way, add the LCD as
shown in Figure 9-19. To make sure your LCD works, test
it with any of the LiquidCrystal library examples included
in the Arduino software, just by changing the pin numbers
to match your own. The pin numbers for these examples
were chosen so as not to conflict with the pins that the
Ethernet controller and SD card use.
@moleitau
@Kurt_Vonnegut
@pomeranian99
To do so, use the sequence mentioned at the beginning of
this section:
• Put the tag in the reader's field
• Click Select Tag
• Click Authenticate
• Click Write Block
Then, to verify it:
The potentiometer on Analog input 1 will be used to
control the speed of scrolling on the LCD. Pins A0 and
A2 will be used as digital outputs, to act as voltage and
ground for this pot. Below is a quick example to test the
LCD.
• Put the tag in the reader's field
• Click Select Tag
• Click Authenticate
• Click Write Block
Display It
This sketch prints
the number of
seconds since the sketch started on
a 2x16-LCD screen attached to an
Arduino.
/*
LCD Example
Context: Arduino
*/
// include the library:
#include <LiquidCrystal.h>
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(9,8, 7, 6,5, 3);
void setup() {
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
// Print a message to the LCD.
lcd.print("I've been running for:");
}
void loop() {
// set the cursor to column 0, line 1
// (note: line 1 is the second row, since counting begins with 0):
lcd.setCursor(0, 1);
// print the number of seconds since reset:
lcd.print(millis()/1000);
}
 
Search WWH ::




Custom Search