Sie sind auf Seite 1von 24

AHMAD SYARIF (11501244004)

Tugas Robotika
1. Program Webcam
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormspplication!"
#
pu$lic partial class Form! % Form
#
We$Cam we$cam;
pu$lic Form!&'
#
(nitiali)eComponent&';
*

pri+ate +oid Form!,Load&o$-ect sender. /+entrgs e'
#
we$cam 0 new We$Cam&';
we$cam.(nitiali)eWe$Cam&re1 img2ideo';
we$cam.Start&';
*
pri+ate +oid Form!,FormClosed&o$-ect sender. FormClosed/+entrgs e'
#
we$cam.Stop&';
*
pri+ate +oid $uttonSimpan,Clic3&o$-ect sender. /+entrgs e'
#
string 1ilenya;
i1 &sa+eFileDialog!.S4owDialog&' 00 System.Windows.Forms.Dialog5esult.67'
#
1ilenya 0 sa+eFileDialog!.File8ame;
img2ideo.(mage.Sa+e&1ilenya';
*
*
pri+ate +oid $utton9engaturan,Clic3&o$-ect sender. /+entrgs e'
#
we$cam.d+anceSetting&';
*
*
*
2. Tugas Proyek (Motor DC, Motor Stepper, Motor Servo, LD air!
a. Motor DC
#include <avr/io.h>
#include <avr/wdt.h>
#include <avr/interrupt.h> /* for sei() */
#include <util/delay.h> /* for _delay_ms() */
#include <avr/pgmspace.h> /* required y usdrv.h */
#include !usdrv.h!
#define "#"$ %
#define &'(')"*"+ ,
#define &-#- %
#define .*/) ,
#define &"+"+ 0
1.2_)123-( uchar us4unction.etup(uchar data[5]){
us#equest_t *rq = (void *)data;
if (rq->#equest=="#"$)
{
switch(rq->w6alue.ytes[%])
{
case &-#-:
)/#*2 &= ~,;
)/#*2 |= (,<<0);
return %;
case .*/):
)/#*2 &= ~,;
)/#*2 &= ~(,<<0);
return %;
case &"+"+:
)/#*2 |= ,;
)/#*2 &= ~(,<<0);
return %;
}
return %;
}
if (rq->#equest==&'(')"*"+)
{
/(#," = rq->w6alue.ytes[%];
return %;
}
return %;
}
int __attriute__((noreturn)) main(){
uchar i;
77#2 = %844;
*((#," = %85,;
*((#,2 = %8%";
wdt_enale(97*/_,.);
us-nit();
us7evice7isconnect();
for (i=%; i<0:%; i++){
wdt_reset();
_delay_ms(0);
}
us7evice(onnect();
sei();
whie(,){
wdt_reset();
us)oll();
}
}
b. Motor Motor Stepper
#include <avr/io.h>
#include <avr/wdt.h>
#include <avr/interrupt.h> /* for sei() */
#include <util/delay.h> /* for _delay_ms() */
#include <avr/pgmspace.h> /* required y usdrv.h */
#include !usdrv.h!
#define &"+"+ %
#define &-#- ,
#define .'* %
#define .)''7 ,
int step[;] = {,!0!;!5};
uint,<_t speed = :%;
void =eda(uint,<_t value){
uint,<_t n;
for(n=%;n<value;n++)
_delay_us(,);
}
1.2_)123-( uchar us4unction.etup(uchar data[5]){
us#equest_t *rq = (void *)data;
static uint,<_t 8;
8 = %;
//'>se>usi arah putaran dan =umlah step
if(rq->#equest==.'*){
)/#*2 = %8%%;
whie(8<rq->w6alue.word){
if(rq->w-nde8.ytes[%]==&"+"+) )/#*2 |= step[8";];
if(rq->w-nde8.ytes[%]==&-#-) )/#*2 |= step[?-(8";)];
=eda(speed);
)/#*2 = %8%%;
wdt_reset();
8++;
}
return %;
}
//'>se>usi pengaturan >ecepatan per step
if(rq->#equest==.)''7){
speed = rq->w6alue.word;
return %;
}
return %;
}
int __attriute__((noreturn)) main(){
uchar i;
77#2 = %844;
wdt_enale(97*/_,.);
us-nit();
us7evice7isconnect();
for (i=%; i<0:%; i++){
wdt_reset();
_delay_ms(0);
}
us7evice(onnect();
sei();

whie(,)
{
wdt_reset();
us)oll();
}
}
c. Motor Servo
#include <mega5.h>
#include <delay.h>
#include <math.h>
#include <stdio.h>
#include <stdli.h>
// *imer % overflow interrupt service routine
interrupt [*-@%_/64] #oi$ timer%_ovf_isr(#oi$)
{
*(+*% = %8%(;
}
#oi$ wa>tu_us(unsi%ne$ short nilai){
it =alan = ,;
unsi%ne$ short wa>tu = nilai;
whie(=alan){
wa>tu--;
if(wa>tu == %) =alan = %;
}
}
#oi$ main(#oi$)
{
// 7eclare your local variales here
unsi%ne$ short nilai! dera=at;
unsi%ne$ char loop;
char >eluar>an[,%]! masu>>an[,%];
// -nput//utput )orts initialiAation
// )ort 2 initialiAation
// 4uncBC-n 4unc<C-n 4unc:C-n 4unc;C-n 4unc?C-n 4unc0C-n 4unc,C-n 4unc%C-n
// .tateBC* .tate<C* .tate:C* .tate;C* .tate?C* .tate0C* .tate,C* .tate%C*
)/#*2=%8%%;
77#2=%8%%;
// )ort ( initialiAation
// 4unc<C-n 4unc:C-n 4unc;C-n 4unc?C-n 4unc0C-n 4unc,C-n 4unc%C-n
// .tate<C* .tate:C* .tate;C* .tate?C* .tate0C* .tate,C* .tate%C*
)/#*(=%8%%;
77#(=%8%%;
// )ort 7 initialiAation
// 4uncBC-n 4unc<C-n 4unc:C-n 4unc;C/ut 4unc?C-n 4unc0C-n 4unc,C-n 4unc%C-n
// .tateBC* .tate<C* .tate:C* .tate;C% .tate?C* .tate0C* .tate,C* .tate%C*
)/#*7=%8%%;
77#7=%8,%;
// *imer/(ounter % initialiAation
// (loc> sourceD .ystem (loc>
// (loc> valueD ,0%%%.%%% >$A
*((#%=%8%,;
*(+*%=%8%(;
// *imer/(ounter , initialiAation
// (loc> sourceD .ystem (loc>
// (loc> valueD *imer, .topped
// @odeD +ormal topC%84444
// /(," outputD 7iscon.
// /(,2 outputD 7iscon.
// +oise (ancelerD /ff
// -nput (apture on 4alling 'dge
// *imer, /verflow -nterruptD /ff
// -nput (apture -nterruptD /ff
// (ompare " @atch -nterruptD /ff
// (ompare 2 @atch -nterruptD /ff
*((#,"=%8%%;
*((#,2=%8%%;
*(+*,$=%8%%;
*(+*,3=%8%%;
-(#,$=%8%%;
-(#,3=%8%%;
/(#,"$=%8%%;
/(#,"3=%8%%;
/(#,2$=%8%%;
/(#,23=%8%%;
// *imer/(ounter 0 initialiAation
// (loc> sourceD .ystem (loc>
// (loc> valueD *imer0 .topped
// @odeD +ormal topC%844
// /(0 outputD 7isconnected
"..#=%8%%;
*((#0=%8%%;
*(+*0=%8%%;
/(#0=%8%%;
// '8ternal -nterrupt(s) initialiAation
// -+*%D /ff
// -+*,D /ff
@(1(#=%8%%;
// *imer(s)/(ounter(s) -nterrupt(s) initialiAation
*-@.&=%8%%;
// 1."#* initialiAation
// (ommunication )arametersD 5 7ataE , .topE +o )arity
// 1."#* #eceiverD /n
// 1."#* *ransmitterD /n
// 1."#* @odeD "synchronous
// 1."#* 2aud #ateD F<%%
1(.#"=%8%%;
1(.#2=%8,5;
1(.#(=%85<;
12##$=%8%%;
12##3=%8;7;
// "nalog (omparator initialiAation
// "nalog (omparatorD /ff
// "nalog (omparator -nput (apture y *imer/(ounter ,D /ff
"(.#=%85%;
.4-/#=%8%%;
// "7( initialiAation
// "7( disaled
"7(.#"=%8%%;
// .)- initialiAation
// .)- disaled
.)(#=%8%%;
// *9- initialiAation
// *9- disaled
*9(#=%8%%;
// +ilai +ormal F% dera=at
dera=at = F%;
whie (,)
{
// nilai pewa>tu C B%% G dera=at * ,0.BBBBBBB5f
nilai = B%% + floor(dera=at * ,0.BBBBBBB5f);

// pengaturan pwm ?% >aliE satu si>lus 0%ms
for(loop = %; loop < ?%; loop++){
)/#*7.; = ,;
wa>tu_us(nilai);
)/#*7.; = %;
wa>tu_us(0%%%%-nilai);
}

// @enerima data dari &omputer melalui pin #8 (.erial)
gets(masu>>an!;);
if(masu>>an[%] == HsH){
masu>>an[%] = H%H;
dera=at = atoi(masu>>an);
}
}
}
d. LED air
#include <mega8.h>
#include <delay.h>
unsigned char ! "#
unsigned char p$m%&'()*+ ! ,"-"-"-"-"-"-"-"-"-"-"-./-)00-*1-12-1-"-"-"-"-"-"-"-"-"-"3#
unsigned char p$m(2"+ ! ,"-"-"-"-"-"-"-"-"-"3#
44 Standard 5nput46utput 7unctions
#include <stdio.h>
44De8larasi variabel global
unsigned long 9i8#
bit :epeat;7lag- Start;7lag- selesai#
unsigned char <yt- 'dd2-Cmd2- 'dd- Cmd#
int =eda ! 0"#
bit 8anan#
44 Eternal 5nterrupt " service routine
interrupt (E>9;5%9"+ void et;int";isr?void@
,
44 Alace your code here
44 Alace your code here
9CC:" ! ""1#
i7 ?<yt<1)@ 9CC:) ! """# 44Disable timer)
i7 ??9i8 >! 2)"@ BB ?9i8 < 20"@@
,
'dd ! 2#
:epeat;7lag ! "#
Start;7lag ! 2#
'dd2 ! "#
Cmd2 ! "#
selesai ! "#
3

i7 ??9i8 >! 22*@ BB ?9i8 < 2)"@@
,
'dd ! )#
:epeat;7lag ! 2#
Start;7lag ! "#
selesai ! 2#
'dd2 ! "#
Cmd2 ! "#
Cmd ! "#
3
i7???9i8 >! ))@ BB ?9i8 < 22*@@ BB ?Start;7lag !! 2@ BB?selesai!!"@@
,
<ytCC#
44<aca 'lamat
i7 ?<yt < D@
,
'dd2 ! 'dd2<<2#
'dd2 ! 'dd2 C 2#
3
44<aca perintah
i7 ??<yt >! 2/@ BB ?<yt < )0@@
,
Cmd2! Cmd2<<2#
Cmd2 ! Cmd2 C 2#
3
3
i7 ???9i8 >! 2"@ BB ?9i8 < ))@@ BB ?Start;7lag !! 2@ BB ?selesai!!"@@
,
<ytCC# 44
i7 ?<yt < D@ 44
,
'dd2 ! 'dd2<<2#
3
i7 ??<yt >! 2/@ BB ?<yt < )0@@
,
Cmd2! Cmd2<<2#
3
3
9i8 ! "#
i7 ?<yt !! 1)@
,
'dd ! 'dd2#
Cmd ! Cmd2#
i7?Cmd !! "*)@ 8anan E! 2#
i7?Cmd !! "'8@ =eda F! 2"#
i7?Cmd !! "E"@ =eda C! 2"#
Cmd ! """#
:epeat;7lag ! "#
Start;7lag ! "#
9CC:" ! """#
<yt ! "#
selesai ! 2#
9CC:) ! ""2#
3
return#
3
44 9imer " over7lo$ interrupt service routine
interrupt (95M";6GH+ void timer";ov7;isr?void@
,
44 :einitialiIe 9imer " value
9C%9"!"EE#
44 Alace your code here
9i8CC#
i7 ?9i8 >! 0""@
,
9i8 ! "#
:epeat;7lag ! "#
Start;7lag ! "#
'dd2 ! "#
Cmd2 ! "#
'dd ! "#
Cmd ! "#
9CC:) ! ""2#
9CC:" ! """#
3
return#
3
44 9imer) over7lo$ interrupt service routine
interrupt (95M);6GH+ void timer);ov7;isr?void@
,
44 Alace your code here
CC#
A6:9C." ! ?p$m("+ <! @#
A6:9C.2 ! ?p$m(2+ <! @#
A6:9C.) ! ?p$m()+ <! @#
A6:9C.1 ! ?p$m(1+ <! @#
A6:9C.. ! ?p$m(.+ <! @#
A6:9C.0 ! ?p$m(0+ <! @#
A6:9D.* ! ?p$m(*+ <! @#
A6:9D.1 ! ?p$m(/+ <! @#
A6:9D.. ! ?p$m(8+ <! @#
A6:9D.0 ! ?p$m(D+ <! @#
3
44 Declare your global variables here
void 8edelai?int lama@,
int loop ! lama#
$hile?loop@,
delay;us?)"@#
loopFF#
3
3
void main?void@
,
44 Declare your local variables here 44444444444444444444444444444444444444444444444444444444
unsigned char i- =#
44char tulisan(1"+#
44 5nput46utput Aorts initialiIation
44 Aort < initialiIation
44 Hunc/!5n Hunc*!5n Hunc0!5n Hunc.!5n Hunc1!5n Hunc)!5n Hunc2!5n Hunc"!5n
44 State/!9 State*!9 State0!9 State.!9 State1!9 State)!9 State2!9 State"!9
A6:9<!"""#
DD:<!"77#
44 Aort C initialiIation
44 Hunc*!5n Hunc0!6ut Hunc.!6ut Hunc1!6ut Hunc)!6ut Hunc2!6ut Hunc"!6ut
44 State*!9 State0!2 State.!2 State1!2 State)!2 State2!2 State"!2
A6:9C!"1H#
DD:C!"1H#
44 Aort D initialiIation
44 Hunc/!6ut Hunc*!6ut Hunc0!6ut Hunc.!6ut Hunc1!6ut Hunc)!5n Hunc2!5n
Hunc"!5n
44 State/!" State*!" State0!" State.!" State1!" State)!9 State2!9 State"!9
A6:9D!"""#
DD:D!"H8#
44 9imer4Counter " initialiIation
44 Cloc8 sourceJ System Cloc8
44 Cloc8 valueJ 28/.0"" 8KI
9CC:"!""1#
9C%9"!"EE#
44 9imer4Counter 2 initialiIation
44 Cloc8 sourceJ System Cloc8
44 Cloc8 valueJ 9imer2 Stopped
44 ModeJ %ormal top!"HHHH
44 6C2' outputJ Discon.
44 6C2< outputJ Discon.
44 %oise CancelerJ 677
44 5nput Capture on Halling Edge
44 9imer2 6ver7lo$ 5nterruptJ 677
44 5nput Capture 5nterruptJ 677
44 Compare ' Match 5nterruptJ 677
44 Compare < Match 5nterruptJ 677
9CC:2'!"""#
9CC:2<!"""#
9C%92K!"""#
9C%92L!"""#
5C:2K!"""#
5C:2L!"""#
6C:2'K!"""#
6C:2'L!"""#
6C:2<K!"""#
6C:2<L!"""#
44 9imer4Counter ) initialiIation
44 Cloc8 sourceJ System Cloc8
44 Cloc8 valueJ 2)""".""" 8KI
44 ModeJ %ormal top!"HH
44 6C) outputJ Disconnected
'SS:!"""#
9CC:)!"""#442#
9C%9)!"""#
6C:)!"""#
44 Eternal 5nterrupt?s@ initialiIation
44 5%9"J 6n
44 5%9" ModeJ Halling Edge
44 5%92J 677
L5C:M!"."#
MCNC:!"")#
L5H:!"."#
44 9imer?s@4Counter?s@ 5nterrupt?s@ initialiIation
95MSO!".2#
44 NS':9 initialiIation
44 Communication AarametersJ 8 Data- 2 Stop- %o Aarity
44 NS':9 :eceiverJ 6n
44 NS':9 9ransmitterJ 6n
44 NS':9 ModeJ 'synchronous
44 NS':9 <aud :ateJ D*""
4PNCS:'!"""#
NCS:<!"D8#
NCS:C!"8*#
N<::K!"""#
N<::L!".D# P4
44 'nalog Comparator initialiIation
44 'nalog ComparatorJ 677
44 'nalog Comparator 5nput Capture by 9imer4Counter 2J 677
'CS:!"8"#
SH56:!"""#
44 'DC initialiIation
44 'DC disabled
'DCS:'!"""#
44 SA5 initialiIation
44 SA5 disabled
SAC:!"""#
44 9Q5 initialiIation
44 9Q5 disabled
9QC:!"""#
44 Llobal enable interrupts
#asm?RseiR@
44Cmd ! getCmd?"@#
$hile ?2@
,
7or?= ! "# = < 20# =CC@,
7or?i ! "# i < 2"# iCC@,
i7?8anan!!2@ p$m(i+ ! p$m%&'(iC=C)+#
else p$m(DFi+ ! p$m%&'(iC=C)+#
3
8edelai?=eda@#
3
3
3
". Program Se#sor ($ompas, %kse&ero!
a. Oompas
#include <mega8010.h>
44 5)C <us 7unctions
#asm
.eSu ;;i)c;port!"2) #A6:9D
.eSu ;;sda;bit!"
.eSu ;;scl;bit!2
#endasm
#include <i)c.h>
#include <stdio.h>
44 'lphanumeric LCD Module 7unctions
#asm
.eSu ;;lcd;port!"20 #A6:9C
#endasm
#include <lcd.h>
44 Declare your global variables here
unsigned char data#
int 8ompas#
unsigned char nilai(*+#
void baca;compass?void@
,
i)c;start?@#
i)c;$rite?"C"@#
i)c;$rite?""2@#
i)c;start?@#
i)c;$rite?"C2@#
data!i)c;read?"@#
i)c;stop?@#
3
void main?void@
,
44 Declare your local variables here
44 5)C <us initialiIation
i)c;init?@#
44 LCD module initialiIation
lcd;init?2*@#
$hile ?2@
,
44 Alace your code here
baca;compass?@#
8ompas!??dataP2.."*)0@C2.."*)0@#

nilai("+!?8ompas42""@M"1"#
nilai(2+!??8ompasT2""@42"@M"1"#
nilai()+!??8ompasT2""@T2"@M"1"#

nilai(1+!?data42""@M"1"#
nilai(.+!??dataT2""@42"@M"1"#
nilai(0+!??dataT2""@T2"@M"1"#

lcd;gotoy?"-"@#
lcd;puts7?RData CMAS"1R@#

lcd;gotoy?"-2@#
lcd;puts7?ROompas !R@#

lcd;gotoy?2)-"@#lcd;putchar?nilai(1+@#
lcd;gotoy?21-"@#lcd;putchar?nilai(.+@#
lcd;gotoy?2.-"@#lcd;putchar?nilai(0+@#

lcd;gotoy?D-2@#lcd;putchar?nilai("+@#
lcd;gotoy?2"-2@#lcd;putchar?nilai(2+@#
lcd;gotoy?22-2@#lcd;putchar?nilai()+@#
lcd;gotoy?2)-2@#lcd;putchar?"DH@#
3#
3
b. '8selero
#include <mega2*.h>
#include <delay.h>
#include <stdio.h>
44 'lphanumeric LCD 7unctions
#include <alcd.h>
#de7ine 'DC;G:EH;9&AE """
44 :ead the 'D conversion result
unsigned int read;adc?unsigned char adc;input@
,
'DMN>!adc;input M ?'DC;G:EH;9&AE B "77@#
44 Delay needed 7or the stabiliIation o7 the 'DC input voltage
delay;us?2"@#
44 Start the 'D conversion
'DCS:'M!"."#
44 Qait 7or the 'D conversion to complete
$hile ??'DCS:' B "2"@!!"@#
'DCS:'M!"2"#
return 'DCQ#
3
44 Declare your global variables here
short -y-I#
unsigned char bu77er()"+#
void main?void@
,
44 Declare your local variables here
44 5nput46utput Aorts initialiIation
44 Aort ' initialiIation
44 Hunc/!5n Hunc*!5n Hunc0!5n Hunc.!5n Hunc1!5n Hunc)!5n Hunc2!5n Hunc"!5n
44 State/!9 State*!9 State0!9 State.!9 State1!9 State)!9 State2!9 State"!9
A6:9'!"""#
DD:'!"""#
44 Aort < initialiIation
44 Hunc/!5n Hunc*!5n Hunc0!5n Hunc.!5n Hunc1!5n Hunc)!5n Hunc2!5n Hunc"!5n
44 State/!9 State*!9 State0!9 State.!9 State1!9 State)!9 State2!9 State"!9
A6:9<!"""#
DD:<!"""#
44 Aort C initialiIation
44 Hunc/!5n Hunc*!5n Hunc0!5n Hunc.!5n Hunc1!5n Hunc)!5n Hunc2!5n Hunc"!5n
44 State/!9 State*!9 State0!9 State.!9 State1!9 State)!9 State2!9 State"!9
A6:9C!"""#
DD:C!"""#
44 Aort D initialiIation
44 Hunc/!5n Hunc*!5n Hunc0!5n Hunc.!5n Hunc1!5n Hunc)!5n Hunc2!5n Hunc"!5n
44 State/!9 State*!9 State0!9 State.!9 State1!9 State)!9 State2!9 State"!9
A6:9D!"""#
DD:D!"""#
44 9imer4Counter " initialiIation
44 Cloc8 sourceJ System Cloc8
44 Cloc8 valueJ 9imer " Stopped
44 ModeJ %ormal top!"HH
44 6C" outputJ Disconnected
9CC:"!"""#
9C%9"!"""#
6C:"!"""#
44 9imer4Counter 2 initialiIation
44 Cloc8 sourceJ System Cloc8
44 Cloc8 valueJ 9imer2 Stopped
44 ModeJ %ormal top!"HHHH
44 6C2' outputJ Discon.
44 6C2< outputJ Discon.
44 %oise CancelerJ 677
44 5nput Capture on Halling Edge
44 9imer2 6ver7lo$ 5nterruptJ 677
44 5nput Capture 5nterruptJ 677
44 Compare ' Match 5nterruptJ 677
44 Compare < Match 5nterruptJ 677
9CC:2'!"""#
9CC:2<!"""#
9C%92K!"""#
9C%92L!"""#
5C:2K!"""#
5C:2L!"""#
6C:2'K!"""#
6C:2'L!"""#
6C:2<K!"""#
6C:2<L!"""#
44 9imer4Counter ) initialiIation
44 Cloc8 sourceJ System Cloc8
44 Cloc8 valueJ 9imer) Stopped
44 ModeJ %ormal top!"HH
44 6C) outputJ Disconnected
'SS:!"""#
9CC:)!"""#
9C%9)!"""#
6C:)!"""#
44 Eternal 5nterrupt?s@ initialiIation
44 5%9"J 677
44 5%92J 677
44 5%9)J 677
MCNC:!"""#
MCNCS:!"""#
44 9imer?s@4Counter?s@ 5nterrupt?s@ initialiIation
95MSO!"""#
44 NS':9 initialiIation
44 NS':9 disabled
NCS:<!"""#
44 'nalog Comparator initialiIation
44 'nalog ComparatorJ 677
44 'nalog Comparator 5nput Capture by 9imer4Counter 2J 677
'CS:!"8"#
SH56:!"""#
44 'DC initialiIation
44 'DC Cloc8 7reSuencyJ *D2.)"" 8KI
44 'DC Goltage :e7erenceJ ':EH pin
44 'DC 'uto 9rigger SourceJ 'DC Stopped
'DMN>!'DC;G:EH;9&AE B "77#
'DCS:'!"8.#
44 SA5 initialiIation
44 SA5 disabled
SAC:!"""#
44 9Q5 initialiIation
44 9Q5 disabled
9QC:!"""#
44 'lphanumeric LCD initialiIation
44 Connections are speci7ied in the
44 Aro=ectMCon7igureMC CompilerMLibrariesM'lphanumeric LCD menuJ
44 :S F A6:9C <it "
44 :D F A6:9C <it 2
44 E% F A6:9C <it )
44 D. F A6:9C <it .
44 D0 F A6:9C <it 0
44 D* F A6:9C <it *
44 D/ F A6:9C <it /
44 Characters4lineJ 2*
lcd;init?2*@#
$hile ?2@
,
44 Alace your code here
!read;adc?"@# 44 :ead 'nalog value 7rom channelF"
y!read;adc?2@# 44 :ead 'nalog value 7rom channelF2
I!read;adc?)@# 44 :ead 'nalog value 7rom channelF)
!F118#
y!yF118#
I!IF118#

lcd;gotoy?"-"@#
lcd;puts?R>!R@#
sprint7?bu77er-RTdR-@#
lcd;puts?bu77er@#

lcd;puts?R &!R@#
sprint7?bu77er-RTdR-y@#
lcd;puts?bu77er@#

lcd;gotoy?"-2@#
lcd;puts?RU!R@#
sprint7?bu77er-RTdR-I@#
lcd;puts?bu77er@#
delay;ms?)"@#
3
3

Das könnte Ihnen auch gefallen