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 #188 background imageLoading...
Page #188 background image
sleepTime = 120 * 60 * 1000;
}
try {
Thread.sleep(sleepTime);
}
catch(InterruptedException ignoreMe) {}
}
}
}
void tweetAlarm() {
ConfigurationBuilder cb = new ConfigurationBuilder();
cb.setDebugEnabled(true)
.setOAuthConsumerKey(API_KEY)
.setOAuthConsumerSecret(API_SECRET)
.setOAuthAccessToken(ACCESS_TOKEN)
.setOAuthAccessTokenSecret(ACCESS_TOKEN_SECRET);
TwitterFactory tf = new TwitterFactory(cb.build());
Twitter twitter = tf.getInstance();
try {
Status status = twitter.updateStatus(
"Someone, please, take me to the beach!"
);
println(
"Successfully updated status to '" + status.getText() + "'."
);
}
catch (TwitterException e) {
e.printStackTrace();
}
}
Whenever new data arrives on the serial port, the Processing runtime environ-
ment calls the
serialEvent
method. There we try to read a line of text, and then
we check whether it contains a decimal number followed by a blank and a C
or an F character. This ensures weve read an actual temperature data set
and not some digital garbage.
If we got a syntactically correct temperature data set, we convert it into a
float
object and check to see whether its greater than
MAX_WORKING_TEMP
. (No one
should be forced to work at temperatures that high!) If yes, we call
tweetAlarm
and Tweet a message to encourage some followers to rescue us. Then we wait
for two hours until our next check. Otherwise, we wait five minutes and check
the temperature again.
tweetAlarm
updates our Twitter status and is simple. In good old Java tradition,
we create a new
Twitter
instance using a
TwitterFactory
. The factory expects a
ConfigurationBuilder
object that we have initialized with our Twitter application
report erratum discuss
Tweeting Messages with Processing 171
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