Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
dmpada
/
eriala-2024
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
c25092cf
authored
Oct 09, 2024
by
Risto Heinsar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added week 1 demo codes
parent
a1fc8ab4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
0 deletions
lab1/lab1_demo_led_blinky/lab1_demo_led_blinky.ino
lab1/lab1_demo_serial/lab1_demo_serial.ino
lab1/lab1_demo_led_blinky/lab1_demo_led_blinky.ino
0 → 100644
View file @
c25092cf
void
setup
()
{
// Seadistame parempoolse LEDi väljundiks
pinMode
(
7
,
OUTPUT
);
}
void
loop
()
{
// Lülitame LEDi sisse 500 ms
digitalWrite
(
7
,
HIGH
);
delay
(
500
);
// Seejärel lülitame LEDi välja ning ootame veel 500 ms
digitalWrite
(
7
,
LOW
);
delay
(
500
);
}
\ No newline at end of file
lab1/lab1_demo_serial/lab1_demo_serial.ino
0 → 100644
View file @
c25092cf
// Globaalmuutuja, loendab mitmendat kordust robot parasjagu teeb
unsigned
int
time
=
0
;
void
setup
()
{
// Seadistame jadaühenduse
Serial
.
begin
(
9600
);
// Saadetakse jadaühendusega ühekordselt roboti käivitusel
Serial
.
println
(
"Tere maailm!"
);
}
void
loop
()
{
// Saadame üle jadaühenduse iga sekundi tagant
Serial
.
println
(
"Beep Boop! Olen Boe-Bot!"
);
Serial
.
print
(
"Käivitusest on möödas "
);
Serial
.
print
(
time
);
Serial
.
print
(
" sekundit
\n
"
);
// Ootame sekundi
delay
(
1000
);
// Suurendame kordusi (aega) 1 võrra
time
++
;
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment