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 #186 background imageLoading...
Page #186 background image
jar
file will automatically be copied to a local folder named
code
.) Thats all you
have to do to give your application access to the Twitter4J library.
We proceed with some boilerplate code:
Ethernet/TweetTemperature/TweetTemperature.pde
import processing.serial.*;
final float MAX_WORKING_TEMP = 32.0;
final int LINE_FEED = 10;
final int BAUD_RATE = 9600;
final int FONT_SIZE = 32;
final int WIDTH = 320;
final int HEIGHT = 240;
final String API_KEY = "<YOUR API KEY>";
final String API_SECRET = "<YOUR API SECRET>";
final String ACCESS_TOKEN = "<YOUR ACCESS TOKEN>";
final String ACCESS_TOKEN_SECRET = "<YOUR ACCESS TOKEN SECRET>";
Serial _arduinoPort;
float _temperature;
boolean _isCelsius;
PFont _font;
void setup() {
size(WIDTH, HEIGHT);
_font = createFont("Arial", FONT_SIZE, true);
println(Serial.list());
_arduinoPort = new Serial(this, Serial.list()[0], BAUD_RATE);
_arduinoPort.clear();
_arduinoPort.bufferUntil(LINE_FEED);
_arduinoPort.readStringUntil(LINE_FEED);
}
void draw() {
background(255);
fill(0);
textFont(_font, FONT_SIZE);
textAlign(CENTER, CENTER);
if (_isCelsius)
text(_temperature + " \u2103", WIDTH / 2, HEIGHT / 2);
else
text(_temperature + " \u2109", WIDTH / 2, HEIGHT / 2);
}
As usual, we import the serial libraries for communicating with the Arduino,
and then we define some constants well need later. Most of them contain the
credentials we need to access the Twitter service. With
MAX_WORKING_TEMP
, you
can define at which temperature the application starts to Tweet. This can be
a degrees Celsius or Fahrenheit value. The rest defines a few values we need
report erratum discuss
Tweeting Messages with Processing 169
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