!"#$%&$ (#) *+,-(,%&$ ./,0 *&)-/#%
1(#$23"4"& 1(56%&$"#7 89!+9
04:;<<(&)-/#%9++
•
•
•
•
*&)-/#% /$ (# %:"#2$%-&+" :0=$/+(5 +%>:-?#@ :5(A%&> )"$/@#") ,% >(B" "C:"&/>"#?#@ ./,0 "5"+,&%#/+$ (#) :&%@&(>>/#@ >%&" D-# (#) /#,-/?6"9 *&)-/#% 0($ /,$ %.# -#/E-"7 $/>:5/F") :&%@&(>>/#@ 5(#@-(@" (#) ( 5%,$ %D :&">()" "C(>5"$ (#) ,-,%&/(5$ "C/$,$9 G/,0 *&)-/#% =%- +(# "($/5= "C:5%&" 5%,$ %D $>(552 $+(5" $"#$%&$ (#) (+,-(,%&$ 5/B" >%,%&$7 ,">:"&(,-&" $"#$%&$7 ",+9 H0" :%$$/I/5/?"$ ./,0 *&)-/#% (&" "#)"5"$$9
•
•
•
•
*&)-/#% /$ (# %:"#2$%-&+" :0=$/+(5 +%>:-?#@ :5(A%&> )"$/@#") ,% >(B" "C:"&/>"#?#@ ./,0 "5"+,&%#/+$ (#) :&%@&(>>/#@ >%&" D-# (#) /#,-/?6"9 *&)-/#% 0($ /,$ %.# -#/E-"7 $/>:5/F") :&%@&(>>/#@ 5(#@-(@" (#) ( 5%,$ %D :&">()" "C(>5"$ (#) ,-,%&/(5$ "C/$,$9 G/,0 *&)-/#% =%- +(# "($/5= "C:5%&" 5%,$ %D $>(552 $+(5" $"#$%&$ (#) (+,-(,%&$ 5/B" >%,%&$7 ,">:"&(,-&" $"#$%&$7 ",+9 H0" :%$$/I/5/?"$ ./,0 *&)-/#% (&" "#)"5"$$9
J(I H%:/+$ •
K6"&6/". %D ,0" *&)-/#% 35(A%&>
•
!"#$%&$ (#) *+,-(,%&$ K6"&6/".
•
K6"&6/". %D H">:"&(,-&" !"#$%&$ 2 3,2LMM7 H0"&>/$,%&7 H0"&>%+%-:5" H0"&>%+%-:5"
•
•
N($/+ O(,( *+E-/$/?%# PO*QR7 O(,( J%@@/#@ S(5/I&(?%#7 T#+"&,(/#,=7 U"$%5-?%#7 *++-&(+=7 U(#@"7 ",+9
•
J%.:($$ V/5,"& />:5">"#,(?%# /# !%W.(&"
•
X",.%&B S%>>-#/+(?%#
•
U"()/#@ O(,( $0"",$
1(&).(&"
5$.3%6)3
%$#$%&'() *+, -./'0. H/#B"&Y/, !"#$%& !0/"5)
H%%5$
H/#B"&B/, !"#$%&$ (#) *+,-(,%&$
1.(2)$2 3(% #04&34)$2
*&)-/#%
!%W.(&" 3&%@&(>>/#@ ./,0 *&)-/#% /$ $/>:5" (#) /#,-/?6"\
*&)-/#% !B",+0 ZO[
[C(>:5"; // include the TinkerKit library #include // creating the object 'led' that belongs to the 'TKLed' class TKLed led(O0);
void setup() { //do something here } void loop() { led.on(); delay(1000); led.off(); delay(1000); }
H0" $=#,(C /$ $/>/5/(& ,% S :&%@&(>>/#@
// // // //
set the LED on wait for a second set the LED off wait for a second
H0/$ :&%@&(> >(B"$ ( J[O I5/#B
!%W.(&" Z#$,(55(?%#; 04:;<<(&)-/#%9++<"#<8(/#
*$$/@#>"#, K6"&6/". 89 #$%&'() 532'02; [C:5%&" ,0" )/]"&"#, !"#$%&$ (#) *+,-(,%&$ (6(/5(I5" ./,0 ,0" *&)-/#% Y/, !9 :4;8<<; S&"(," =%-& %.# 3,2LMM $"#$%& ./,0 H&(#$>/4"& D&%> $+&(,+0 (#) U"() H">:"&(,-&" 6(5-"$ -$/#@ *&)-/#% ^9 S&"(," ( =.>?.$34&$. -343 @)AA.$<[>I"))") O*Q !=$,"> !"" #"C, $5/)"$ D%& >%&" )",(/5$999
!"#$%&$ (#) *+,-(,%&$ •
•
H0"%&=
* 1.(2)$ /$ ( +%#6"&,"& ,0(, >"($-&"$ ( :0=$/+(5 E-(#?,= (#) +%#6"&,$ /, /#,% ( $/@#(5 .0/+0 +(# I" &"() I= (# %I$"&6"& %& I= (# P,%)(= >%$,5= "5"+,&%#/+R /#$,&->"#,9 *# #04&34)$ /$ ( ,=:" %D >%,%& D%& >%6/#@ %& +%#,&%55/#@ ( >"+0(#/$> %& $=$,">9 Z, /$ %:"&(,") I= ( $%-&+" %D "#"&@=7 ,=:/+(55= "5"+,&/+ +-&&"#,7 0=)&(-5/+ _-/) :&"$$-&"7 %& :#"->(?+ :&"$$-&"7 (#) +%#6"&,$ ,0(, "#"&@= /#,% >%?%#9 *# (+,-(,%& /$ ,0" >"+0(#/$> I= .0/+0 ( +%#,&%5 $=$,"> (+,$ -:%# (# "#6/&%#>"#,9 04:;<<"#9./B/:")/(9%&@<./B/
04:;<<"#9./B/:")/(9%&@<./B/<*+,-(,%&
!"#$%&$ B3C'6$3D)(; * +%>:(&/$%# I",.""# >"($-&">"#,$9 K#" %D B#%.# >(@#/,-)" %& +%&&"+,#"$$ >()" %& $", ./,0 %#" )"6/+" (#) (#%,0"& >"($-&">"#, >()" /# ($ $/>/5(& ( .(= ($ :%$$/I5" ./,0 ( $"+%#) )"6/+"9 H0" )"6/+" ./,0 ,0" B#%.# %& ($$/@#") +%&&"+,#"$$ /$ +(55") ,0" $,(#)(&)9 H0" $"+%#) )"6/+" /$ ,0" -#/, -#)"& ,"$,7 ,"$, /#$,&->"#,7 %& (#= %D $"6"&(5 %,0"& #(>"$ D%& ,0" )"6/+" I"/#@ +(5/I&(,")9
H0"%&=
#00&$30F; 1%. +5%$" ,0" >"($-&") 6(5-" /$ ,0" ,0" (+,-(5<&"(5 6(5-"7 "@97 bM9L c
E.2)C&D)(; H0" $>(55"$, +0(#@" /, +(# )","+, /# ,0" E-(#?,= ,0(, /, /$ >"($-&/#@9 H0" D%55%./@ D%&>-5( >(= I" -$") P.0"&" ! /$ ,0" >"($-&>"#, $:(#7 "9@97 M2LMM)"@9SR;
Z# ,0" ($$/@#>"#, =%- #"") ,% )"(5 ./,0 ,0"$" :(&(>","&$9 `%- F#) /#D%&>(?%# (I%-, ,0"$" :(&(>","&$ /# ,0" O(,( $0"", D%& =%-& )"6/+" 04:;<<"#9./B/:")/(9%&@<./B/
3(&, L
*&)-/#% N($/+$
d"e#@ !,(&,") ./,0 *&)-/#% 1(#$23"4"& 1(56%&$"#7 89!+9
N%%B$
H0"$" I%%B$ @/6"$ =%- (# /#,&%)-+?%# ,% *&)-/#%9 H0"$" I%%B$ (&" (6(/5/I5" %# ,0" 5(I9
!"5"+,") .5))G2 D&%> !(D(&/ K#5/#" (6(/5(I5" D%& D&"" D%& !,-)"#,$ (#) H"(+0"&$ (, HTS 04:;<<:&%E-"$,9$(D(&/I%%B$%#5/#"9+%>
04:;<<:&%E-"$,9$(D(&/I%%B$%#5/#"9+%>
04:;<<:&%E-"$,9$(D(&/I%%B$%#5/#"9+%>< I%%B<0(&).(&"2(#)2@()@",$< fghLiif^Lijjh
#$%&'() *() 5)3
%$*&)-/#% N($/+$ 5$.3%6)3
%$1.(2)$2 3(% #04&34)$2
H0" *&)-/#% Y/, #$%&'() *() 5)3
%$1>3CC;2'I. 1.(2)$2 3(% #04&34)$2
d"e#@ !,(&,") ./,0 *&)-/#%; 04:;<<(&)-/#%9++<"#"3(@"
H0" *&)-/#% Y/, •
*&)/%#% 1%>" 3(@"; 04:;<<(&)-/#%9++
•
H0" *&)-/#% !,(&,"& Y/,;
04:;<<(&)-/#%9++<"#<8(/#<*&)-/#%!,(&,"&Y/, •
!,(&,"& Y/, k/)"%$; 04:$;<<...9=%-,-I"9+%><:5(=5/$,l D"(,-&"m")/,a%Bn5/$,m3JHj&VaZoBB#3DpE5kV561igE16E6qBB#)
d"e#@ !,(&,"); [C:5%&" $%>" %D ,0" ,0" D%55%./#@ $"#$%&$<(+,-(,%&$r •
*&)-/#% ./,0 N&"()I%(&) –
–
–
–
–
•
J[O7 3-$0 N-4%# OS 8%,%& H">:"&(,-&" 3G8%,%& (#) OS2>%,%& ",+9
H/#B"&B/,; –
–
–
–
J[O H">:"&(,-&" 3%,"#?%>","& ",+9
3(&, p
3,2LMM 8"($-&">"#,$
1(#$23"4"& 1(56%&$"#7 89!+9
H">:"&(,-&" 8"($-&">"#,$ :48<<; S&"(," =%-& %.# ,">:%&(&= 3,2LMM $"#$%& ./,0 H&(#$>/4"& P+&"(," ,0" +/&+-/, %# ( I&"()I%(&)R (#) ,0"# U"() H">:"&(,-&" 6(5-"$ -$/#@ *&)-/#%9 !-@@"$,") H($B$; –
–
–
S%>:(&" ./,0 "C/$?#@ 3,2LMM ./,0 H&(#$>/4"& "E-/:>"#, PU"D"&"#+" [E-/:>"#,R S%>:(&" ./,0 H">:"&(,-&" !"#$%&$ (6(/5(I5" ./,0/# ,0" *&)-/#% Y/, PH83^j7 H0"&>/$,%&7999R S%>:(&" (#) O/$+-$$ ,0" D%55%./#@ H">:"&(,-&" 8"($-&">"#,$r 3,2LMM7 H0"&>%+%-:5"7 H0"&>/$,%& P8"($-&">"#, :&/#+/:5"$7 ",+9R
3,2LMM G/&/#@
3,LMM ,&(#$)-+"&
Z#,"(5 ,"&>/#(5 I5%+B
J
X
" , , ) / ) ) 0 " " k - # & . & : O O O i , % H H H p - & U U U u K d
xxxxxxx S(I5" +5(>: 3,LMM "5">"#,
Mk
u pi k &") UHO
,&(#$)-+"&
&")
3,LMM pi k 3!T
.0/," v i2pM >* u spoM t
K-,:-, ,"&>/#(5$
u , : , K
w , : , K
L2o k %-,:-, ,"&>/#(5$ w
L>?)$43(4M H"$, ,0" %-,:-, %D =%-& +/&+-/, N[VKU[ +%##"+?#@ /, ,% ,0" *&)-/#% *#(5%@ Z#:-, ./,0 ( 8-5?>","& ,% >(B" $-&" ,0" 6%5,(@" /$ #%, 0/@0"& ,0(# ok7 "5$" ,0"
S&"(," =%- %.# 3,2LMM !"#$%& ./,0 H&(#$>/4"& H"$, ,0" O"6/+" -$/#@ *&)-/#%
=.>?.$34&$. =$3(2>'S.$ T<;8<<%.A9 BU
:4;8<<
04:$;<<...9"5D(9$"<"5D(^s"-a"#<"5D(#/,9)%l /,">mgj2jfM2oLn,%+mMnEmgj2jfM2oL
!JO-BP<9!Q# :)R.$ 1&??CF
04:$;<<...9"5D(9$"<"5D(^s"-a"#<"5D(#/,9)%l /,">mgj2hfo2gin,%+mMnEmgj2hfo2gi
5$.3%6)3
%$04:$;<<...9"5D(9$"<"5D(^s"-a"#<"5D(#/,9)%l/,">mjf2MjL2gfn,%+mMnEmjf2MjL2gf
J
X
Mk
Z>:%&,(#,\\\
u pi k &") UHO
,&(#$)-+"&
&")
3,LMM
.0/," v i2pM >* u spoM t
L2o k %-,:-, ,"&>/#(5$ w
•
•
•
H"$, ,0" %-,:-, %D =%-& +/&+-/, N[VKU[ +%##"+?#@ /, ,% ,0" *&)-/#% *#(5%@ Z#:-, T$" ( 8-5?>","& ,% >(B" $-&" ,0" 6%5,(@" /$ #%, 0/@0"& ,0(# ok ZD #%,7 ,0" *&)-/#% ./55 I" )(>(@")\
!>(552$+(5" H">:"&(,-&" !"#$%&$ =V:H7
04:$;<<...9$:(&BD-#9+%><:&%)-+,$mg^2hhf2pfn,%+mMnEmg^2hhf2pf
+=B =W.$>'24)$
04:$;<<...9"5D(9$"<"5D(^s"-a"#<"5D(#/,9)%l/,">mjM2pjM2iLn,%+mMnEmjM2pjM2iL
k%5,(@"2I($") !"#$%&$ *++%&)/#@ ,% ,0" H83^j )(,($0"",7 ,0" &"5(?%# %D ,0" %-,:-, 6%5,(@" ,% ,0" (+,-(5 ,">:"&(,-&" -$"$ ,0/$ "E-(?%#;
H83^j
,">: /# S"5$/-$ m P6%5,(@" 2 oMMR < LM >k
G0"&" ,0" 6%5,(@" 6(5-" /$ $:"+/F") /# >/55/6%5,$9 1%."6"&7 I"D%&" =%- -$" ,0(, "E-(?%#7 =%- >-$, +%#6"&, ,0" /#,"@"& 6(5-" ,0(, ,0" (#(5%@U"() D-#+?%# &",-$ /#,% ( >/55/6%5, 6(5-"9 `%- B#%. ,0(, D%& ( oMMM>k PokR 6(5-" $:(# ,0" (#(5%@U"() D-#+?%# ./55 &",- LMpi :%$$/I5" 6(5-"$;
6%5,(@" m PoMMM < LMpiR y %-,:-, G0"&"
>k
%-,:-, m (#(5%@U"()P(/+0(##"5R
O(,($0"", S(5+-5(?%#$ H0"%&=
J/#"(& &"5(?%#$0/:;
`%- 0(6" ,% F#) ( P$5%:"R (#) I P/#,"&+":,R;
H0/$ @/6"$;
H83^j H">:"&(,-&" !"#$%& [C(>:5" // We'll use analog input 0 to read Temperature Data const int temperaturePin = 0; void setup() { Serial.begin(9600); } void loop() { float voltage, degreesC, degreesF; voltage = getVoltage(temperaturePin);
// Now we'll convert the voltage to degrees Celsius. // This formula comes from the temperature sensor datasheet: degreesC = (voltage - 0.5) * 100.0;
// Send data from the Arduino to the serial monitor window Serial.print("voltage: "); Serial.print(voltage); Serial.print(" deg C: "); Serial.println(degreesC); delay(1000); // repeat once per second (change as you wish!) }
float getVoltage(int pin) { return (analogRead(pin) * 0.004882814); // This equation converts the 0 to 1023 value that analogRead() // returns, into a 0.0 to 5.0 value that is the true voltage // being read at that pin. }
!"&/(5 8%#/,%&
U"$/$,(#+"2I($") !"#$%&$ H0" :&%I5"> ./,0 &"$/$,(#+" $"#$%&$ /$ ,0(, ,0" *&)-/#% (#(5%@ H0"%&= /#,"&D(+"$ +(#z, )/&"+,5= )","+, &"$/$,(#+" +0(#@"$9 H0"&>/$,%& H0/$ ./55 &"E-/&" $%>" "C,&( "5"+,&%#/+ +%>:%#"#,$9 H0" "($/"$, .(= ,% )","+, ( +0(#@" /# &"$/$,(#+" /$ ,% +%#6"&, ,0(, +0(#@" ,% ( 6%5,(@" +0(#@"9 `%- )% ,0(, -$/#@ ( /)C43A. %'/'%.$ 7 ($ $0%.# I"5%.9 N= B"":/#@ ,0" :%."& $%-&+" %-,:-, +%#$,(#,7 ($ ,0" &"$/$,(#+" %D ,0" $"#$%& +0(#@"$7 ,0" 6%5,(@" )/6/)"& +/&+-/, +0(#@"$7 (#) ,0" %-,:-, 6%5,(@" +0(#@"$9 H0" $/q" %D &"$/$,%& =%- #"") D%& ,0" UL &"$/$,%& )":"#)$ %# ,0" &"$/$,(#+" &(#@" @"#"&(,") I= ,0" $"#$%& (#) 0%. $"#$/?6" =%.(#, ,0" %-,:-, 6%5,(@" ,% +0(#@"9
[9@97 ,0" !,"/#0(&,21(&, [E-(?%# +(# I" -$") ,% F#) ,0" H">:"&(,-&";
d"#"&(55=7 ( 6(5-" I",.""# LY (#) LMY %0>$ .%&B$ {-$, F#" ,% +&"(," ( >"(#/#@D-5 %-,:-, 6%5,(@" ,0(, =%- +(# )","+, /# =%-& *&)-/#% (#(5%@ /#:-, /#,"&D(+"9
XHS H0"&>/$,%& [C(>:5" // Read Temerature Values from NTC Thermistor const int temperaturePin = 0; void setup() { Serial.begin(9600); } void loop() { int temperature = getTemp(); Serial.print("Temperature Value: "); Serial.print(temperature); Serial.println("*C"); delay(1000); } double getTemp() { // Inputs ADC Value from Thermistor and outputs Temperature in Celsius
!"&/(5 8%#/,%&
int RawADC = analogRead(temperaturePin); long Resistance; double Temp; // Assuming a 10k Thermistor. Calculation is actually: Resistance = (1024/ADC) Resistance=((10240000/RawADC) - 10000); // Utilizes the St einhart- Hart Thermi stor Equat ion: // Temperature in Kelvin = 1 / {A + B[ln(R)] + C[ln(R)]^3} // where A = 0.001129148, B = 0.000234125 and C = 8.76741E-08 Temp = log(Resistance); Temp = 1 / (0.001129148 + (0.000234125 * Temp) + (0.0000000876741 * Temp * Temp * Temp)); Temp = Temp - 273.15; return Temp; }
// Convert Kelvin to Celsius
// Return the Temperature
!,"/#0(&,21(&, [E-(?%#;
3(&, ^
H">:"&(,-&" O(,( J%@@"&< [>I"))") O*Q !=$,">
1(#$23"4"& 1(56%&$"#7 89!+9
H">:"&(,-&" O(,( J%@@"&< [>I"))") O*Q !=$,"> `%- -$" ,0" 3S .0"# +&"(?#@ ,0" $%W.(&"7 ,0"# =%)%.#5%() ,0" $%W.(&" ,% ,0" *&)-/#% (#) )/$+%##"+, ,0" T!N +(I5"9 T$" ( fk I(4"&= ($ 3%."& !-::5=9
XHS H0"&>/$,%&
T$" )/]"&"#, H">:"&(,-&" $"#$%&$ D%& +%>:(&/$%#7 /9" 5%@ )(,( D&%> (, 5"($, p )/]"&"#, $"#$%&$ (, ,0" $(>" ?>"9
H">:"&(,-&" O(,( J%@@"&< [>I"))") O*Q !=$,"> S&"(," ( =.>?.$34&$. @)AA.$<[>I"))") O*Q !=$,">9 !-@@"$,") H($B$; •
•
•
•
•
•
S&"(," (#) -$" ( @)R?322 Y'C4.$P#/.$3A. Y'C4.$
#C3$> D-#+?%#(5/,=; T$" J[O$ ./,0 )/]"&"#, +%5%&$ .0"# H">:"&(,-&" /$ (I%6"/,$ T$" "9@97 *&)-/#% Z'; Y'P[4W.$(.4 1W'.C% D%& S%>>-#/+(?%# %6"& ( #",.%&B P%& -$" ,0" >/+&%!O +(&) %# ,0"$" $0/"5)$R !(6" ,0" )(,( ,% ( >/+&%!O +(&) 5%+(,") %# ,0" G/2 V/<[,0"", !0/"5) 2 %& +%##"+, "9@97 ,% \'/.CF90)> %& 4.>6))90)> .0/+0 /$ D&"" )(,(5%@@/#@ $/,"$9 J%@ H">:"&(,-&" O(,( D%& "9@97 pi 0%-&$ (#) />:%&, O(,( /#,% [C+"57 J(IkZ[G %& 8*HJ*N D%& *#(5=$/$ (#) k/$-(5/q(?%# T$" "9@9 ( fk I(4"&= ($ :%."& $%-&+" ,% >(B" /, :%&,(I5" (#) $>(55
*&)-/#% G/2V/<[,0"", !0/"5) 04:;<<(&)-/#%9++<"#
G/,0 ,0" *&)-/#% G/2V/<[,0"", !0/"5)7 ,0/$ 5/I&(&= (55%.$ (# *&)-/#% I%(&) ,% +%##"+, ,% ,0" /#,"",9 Z, +(# $"&6" ($ "/,0"& ( $"&6"& (++":?#@ /#+%>/#@ +%##"+?%#$ %& ( +5/"#, >(B/#@ %-,@%/#@ %#"$9
*&)-/#% G/2V/ J/I&(&=; 04:;<<(&)-/#%9++<"#
O/$+&"," J%.:($$ V/5,"& J%.:($$ V/5,"& H&(#$D"& D-#+?%#; G" )"F#";
Z#6"&$" J(:5(+" @/6"$ ,0" )/]"&"#?(5 [E-(?%#;
H0/$ @/6"$; G" -$" ,0" [-5"& N(+B.(&) >",0%);
H0/$ @/6"$;
V/5,"& %-,:-,
X%/$= /#:-, $/@#(5
H0/$ (5@%&/,0> +(# I" "($5= />:5">"#,") /# ( 3&%@&(>>/#@ 5(#@-(@"
|/6"5= `%- >(= .(#, ,% +%##"+, "9@97 ,% C/6"5=9+%>7 ( D&"" )(,(5%@@/#@ $/," 04:$;<
T$" ,0" }|/6"5= D%& *&)-/#%~ 5/I&(&= /# %&)"& ,% +%##"+, (#) $,%&" >"($-&">"#, )(,( D&%> =%-& *&)-/#% )"6/+" /#,% ,0" |/6"5= +5%-)
*&)-/#% C/6"5=9+%>; 04:$;<<)"6<,-,%&/(5$<(&)-/#%a./2F *#%,0"& (5,"(?6" /$;
...9,">I%%9+%> ...9,">I%%9+%><(&)-/#%