Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

dmpada / eriala-2024

  • This project
    • Loading...
  • Sign in
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 7 months ago by Risto Heinsar's avatar Risto Heinsar
Browse files
Options
  • Browse Files
  • Download
  • Email Patches
  • Plain Diff

Added week 1 demo codes

parent a1fc8ab4 master
Show whitespace changes
Inline Side-by-side
Showing 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
This diff is collapsed. Click to expand it.
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
This diff is collapsed. Click to expand it.
  • Write
  • Preview
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment