SlideShare ist ein Scribd-Unternehmen logo
1 von 55
Downloaden Sie, um offline zu lesen
Prižiganje lučk
z Arduinom
Kaj bomo danes počele?
Spoznale:
● Arduino Nano
● Testno ploščico (Breadboard)
● LED lučke, upornike, žičke, foto senzorje
● Osnove programiranja v C++ (spremenljivke, funkcija, for zanka)
● Koda: https://github.com/22nds/lfu-arduino-basics
● Arduino IDE: https://www.arduino.cc/en/Main/Software
Kaj potrebujemo?
● 2 x LED
● 1 x RGB LED
● 3 x 220 Ohm upornik
● 1 x 1k Ohm upornik
● 2 x žičke
● 1 x gumb
● 1 x senzor svetlobe
● Testna ploščica (Breadboard)
● USB kabel
● Računalnik
● Programska oprema (Arduino, Processing)
Arduino Nano Arduino Uno ->
● Uradna stran: https://store.arduino.cc/arduino-nano
Programska oprema za Arduino
● Arduino IDE https://www.arduino.cc/en/Main/Software ali
● Arduino Editor (online) https://create.arduino.cc/editor/ ali
● ArduinoDroid (Android): https://play.google.com/store/apps/details?id=name.antonsmirnov.android.arduinodroid2
Nastavitve za Arduino v Arduino IDE (Win/Linux)
sudo chmod 777 /dev/ttyUSB0
Namestitev gonilnikov za Windows
● /driver/CH34x_Install_Windows_v3_4.zip ali
● http://sparks.gogo.co.nz/ch340.html ali
● http://www.arduined.eu/ch340-windows-8-driver-download/
Gonilniki za Mac
https://kig.re/2014/12/31/how-to-use-arduino-nano-mini-pro-with-CH3
40G-on-mac-osx-yosemite.html
Na Linuxu so gonilniki že nameščeni!
Source: https://static.ebayinc.com/static/assets/Uploads/Stories/Articles/_resampled/ScaleWidthWyI3NTgiXQ/castroevent3.jpg
Analogni pini
analogRead()
Digitalni pini
pinMode()
DigitalRead()
DigitalWrite()
AnalogWrite() - PWM
3, 5, 6, 9, 10, 11
Napajanje
Power LED
Test LED 13 (LED_BUILTIN)
Napajanje
Testna ploščica
LED lučke
LED RGB LED
+- R-GB
Uporniki - moč in računanje upora
Upornik se upira električnemu toku in mu
preprečuje, da bi nemoteno tekel skozenj.
Napetost (V) = Tok(I) * Upor(R)
Upor: 220 Ohmov
Napetost: 5 Voltov
====================
Tok: 23 mA (mili amperov)
5V = 23 mA * 220 Oh
5V = 0.0227A * 220 Oh
100 Ohm 220 Ohm 1k Ohm
http://www.resistorguide.com/resistor-color-code-calculator/
http://www.resistorguide.com/resistor-color-code-calculator/
http://www.resistorguide.com/resistor-color-code-calculator/
Lučka brez programa [00]
Utripanje lučke [01]
int LED = 2;
void setup() {
pinMode(LED, OUTPUT);
}
void loop() {
digitalWrite(LED, HIGH);
delay(1000);
digitalWrite(LED, LOW);
delay(1000);
}
[01]
[02]Utripanje lučke ob pritisku na gumb
Utripanje lučke ob pritisku na gumb [02]
Izmenično utripanje LED lučk [03]
Izmenično utripanje [03]
int led_one = 2;
int led_two = 3;
void setup() {
// set up LED as OUTPUT
pinMode(led_one, OUTPUT);
pinMode(led_two, OUTPUT);
}
void loop() {
digitalWrite(led_one, HIGH);
digitalWrite(led_two, LOW);
delay(500); // wait 0.5 second
digitalWrite(led_one, LOW);
digitalWrite(led_two, HIGH);
delay(500); // wait 0.5 second
}
[03]
RGB lučka
PWM pins *
Pulse Width Modulation
[04]
[05]
B G - R
RGB lučka menja barve [04]
int redPin = 3;
int greenPin = 6;
int bluePin = 5;
void setup() {
pinMode(redPin, OUTPUT);
pinMode(greenPin, OUTPUT);
pinMode(bluePin, OUTPUT);
}
void loop()
{
setColor(255, 0, 0); // red
delay(3000);
setColor(0, 255, 0); // green
delay(2000);
setColor(0, 0, 255); // blue
delay(1000);
}
void setColor(int red, int green, int blue)
{
analogWrite(redPin, red);
analogWrite(greenPin, green);
analogWrite(bluePin, blue);
}
[04]
RGB lučka pulzajoče barve [05]
int redPin = 3;
int greenPin = 5;
int bluePin = 6;
int i;
void setup() {
// set up OUTPUTS
pinMode(redPin, OUTPUT);
pinMode(greenPin, OUTPUT);
pinMode(bluePin, OUTPUT);
}
void loop()
{
for (i=0; i<=255; i++) {
analogWrite(redPin, i);
analogWrite(greenPin, 0);
analogWrite(bluePin, 0);
delay(5);
}
}
[05]
Senzorji in serial port
Foto-upornik & Serial port [06]
Senzor svetlobe in LED lučka [07]
Senzor svetlobe in
LED lučka
[07]
int sensorPin = A7;
int led = 3;
int input;
int output;
void setup() {
Serial.begin(9600);
}
void loop()
{
input = analogRead(sensorPin);
output = input / 4;
delay(1000);
analogWrite(led, output);
Serial.print( input);
Serial.print( " - ");
Serial.println( output);
}
[07]
Processing Demo
https://processing.org/download/
Processing [08]
Foto-upornik & Serial port [08]
[08]int sensorPin = A7;
int input;
int output;
void setup() {
Serial.begin(9600);
}
void loop()
{
input = analogRead(sensorPin);
output = input / 4;
delay(10);
Serial.println( output );
}
Processing sketch [08]
Processing - Rezultat [08]
Povezave
https://www.arduino.cc/
https://create.arduino.cc/projecthub
https://create.arduino.cc/editor
https://www.tinkercad.com/
http://fritzing.org/download/
https://smakshop.si
http://www.dx.com/s/arduino
https://www.arduino.cc/reference/en/
Extra
Namestitev gonilnikov za Windows - 2
● http://www.wch.cn/download/CH341SER_ZIP.html
SETUP.EXE

Weitere ähnliche Inhalte

Was ist angesagt?

Capabilities of Arduino (including Due)
Capabilities of Arduino (including Due)Capabilities of Arduino (including Due)
Capabilities of Arduino (including Due)
Sudar Muthu
 
Introduction to arduino ppt main
Introduction to  arduino ppt mainIntroduction to  arduino ppt main
Introduction to arduino ppt main
eddy royappa
 
Smart Lamp With a GSM Module SIM800L
Smart Lamp With a GSM Module SIM800LSmart Lamp With a GSM Module SIM800L
Smart Lamp With a GSM Module SIM800L
farid_giffari
 

Was ist angesagt? (19)

Arduino tutorial A to Z
Arduino tutorial A to ZArduino tutorial A to Z
Arduino tutorial A to Z
 
Intro to-the-arduino
Intro to-the-arduinoIntro to-the-arduino
Intro to-the-arduino
 
Arduino
ArduinoArduino
Arduino
 
Apostila arduino
Apostila arduinoApostila arduino
Apostila arduino
 
Capabilities of Arduino (including Due)
Capabilities of Arduino (including Due)Capabilities of Arduino (including Due)
Capabilities of Arduino (including Due)
 
Arduino
ArduinoArduino
Arduino
 
Mom presentation_monday_arduino in the physics lab
Mom presentation_monday_arduino in the physics labMom presentation_monday_arduino in the physics lab
Mom presentation_monday_arduino in the physics lab
 
Arduino
ArduinoArduino
Arduino
 
Arduino Introduction by coopermaa
Arduino Introduction by coopermaaArduino Introduction by coopermaa
Arduino Introduction by coopermaa
 
Arduino Workshop Day 2
Arduino  Workshop Day 2Arduino  Workshop Day 2
Arduino Workshop Day 2
 
1.Arduino Ecosystem.pptx
1.Arduino Ecosystem.pptx1.Arduino Ecosystem.pptx
1.Arduino Ecosystem.pptx
 
Arduino
ArduinoArduino
Arduino
 
Powerful Electronics with Arduino
Powerful Electronics with ArduinoPowerful Electronics with Arduino
Powerful Electronics with Arduino
 
Basics of arduino uno
Basics of arduino unoBasics of arduino uno
Basics of arduino uno
 
What are the different types of arduino boards
What are the different types of arduino boardsWhat are the different types of arduino boards
What are the different types of arduino boards
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
 
Introduction to arduino ppt main
Introduction to  arduino ppt mainIntroduction to  arduino ppt main
Introduction to arduino ppt main
 
SMART LAMP WITH A GSM MODULE SIM 800 L
SMART LAMP WITH A GSM MODULE SIM 800 LSMART LAMP WITH A GSM MODULE SIM 800 L
SMART LAMP WITH A GSM MODULE SIM 800 L
 
Smart Lamp With a GSM Module SIM800L
Smart Lamp With a GSM Module SIM800LSmart Lamp With a GSM Module SIM800L
Smart Lamp With a GSM Module SIM800L
 

Ähnlich wie Prižiganje lučk z Arduinom

Magnetic door lock using arduino
Magnetic door lock using arduinoMagnetic door lock using arduino
Magnetic door lock using arduino
Sravanthi Sinha
 
Arduino_UNO _tutorial_For_Beginners.pptx
Arduino_UNO _tutorial_For_Beginners.pptxArduino_UNO _tutorial_For_Beginners.pptx
Arduino_UNO _tutorial_For_Beginners.pptx
ANIKDUTTA25
 
LEDs and DIPs Switches
LEDs and DIPs SwitchesLEDs and DIPs Switches
LEDs and DIPs Switches
Bach Nguyen
 

Ähnlich wie Prižiganje lučk z Arduinom (20)

Simply arduino
Simply arduinoSimply arduino
Simply arduino
 
arduinoSimon.ppt
arduinoSimon.pptarduinoSimon.ppt
arduinoSimon.ppt
 
arduinoSimon.ppt
arduinoSimon.pptarduinoSimon.ppt
arduinoSimon.ppt
 
arduinoSimon.ppt
arduinoSimon.pptarduinoSimon.ppt
arduinoSimon.ppt
 
P-Space Arduino/Genuino day 2016
P-Space Arduino/Genuino day 2016P-Space Arduino/Genuino day 2016
P-Space Arduino/Genuino day 2016
 
Arduino اردوينو
Arduino اردوينوArduino اردوينو
Arduino اردوينو
 
Lab 2_ Programming an Arduino.pdf
Lab 2_ Programming an Arduino.pdfLab 2_ Programming an Arduino.pdf
Lab 2_ Programming an Arduino.pdf
 
2015-10-21 - Arduino workshop
2015-10-21 - Arduino workshop2015-10-21 - Arduino workshop
2015-10-21 - Arduino workshop
 
arduino.ppt
arduino.pptarduino.ppt
arduino.ppt
 
Arduino: Intro and Digital I/O
Arduino: Intro and Digital I/OArduino: Intro and Digital I/O
Arduino: Intro and Digital I/O
 
Internet of thing: Trabajando con Arduino y Visual Studio
Internet of thing: Trabajando con Arduino y Visual StudioInternet of thing: Trabajando con Arduino y Visual Studio
Internet of thing: Trabajando con Arduino y Visual Studio
 
Magnetic door lock using arduino
Magnetic door lock using arduinoMagnetic door lock using arduino
Magnetic door lock using arduino
 
Arduino intro.pptx
Arduino intro.pptxArduino intro.pptx
Arduino intro.pptx
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
 
LinnStrument : the ultimate open-source hacker instrument
LinnStrument : the ultimate open-source hacker instrumentLinnStrument : the ultimate open-source hacker instrument
LinnStrument : the ultimate open-source hacker instrument
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
 
I made some more expansion board for M5Stack
I made some more expansion  board for M5StackI made some more expansion  board for M5Stack
I made some more expansion board for M5Stack
 
Arduino_UNO _tutorial_For_Beginners.pptx
Arduino_UNO _tutorial_For_Beginners.pptxArduino_UNO _tutorial_For_Beginners.pptx
Arduino_UNO _tutorial_For_Beginners.pptx
 
LEDs and DIPs Switches
LEDs and DIPs SwitchesLEDs and DIPs Switches
LEDs and DIPs Switches
 

Mehr von Maja Kraljič

Mehr von Maja Kraljič (12)

MozFest London 2019 - Feminist internet and feminist principles of the internet
MozFest London 2019  - Feminist internet and feminist principles of the internetMozFest London 2019  - Feminist internet and feminist principles of the internet
MozFest London 2019 - Feminist internet and feminist principles of the internet
 
Safer Online Communication
Safer Online CommunicationSafer Online Communication
Safer Online Communication
 
Feminist Principles of the Internet - Lesbians Who Tech London Summit 2018
Feminist Principles of the Internet - Lesbians Who Tech London Summit 2018Feminist Principles of the Internet - Lesbians Who Tech London Summit 2018
Feminist Principles of the Internet - Lesbians Who Tech London Summit 2018
 
Tech workshops at Lesbian-Feminist University
Tech workshops at Lesbian-Feminist UniversityTech workshops at Lesbian-Feminist University
Tech workshops at Lesbian-Feminist University
 
Ubuntu 18.04 Bionic Beaver Installation Party
Ubuntu 18.04 Bionic Beaver Installation PartyUbuntu 18.04 Bionic Beaver Installation Party
Ubuntu 18.04 Bionic Beaver Installation Party
 
Ada Lovelace Day 2017
Ada Lovelace Day 2017Ada Lovelace Day 2017
Ada Lovelace Day 2017
 
Get to know linux - First steps with Ubuntu
Get to know linux - First steps with UbuntuGet to know linux - First steps with Ubuntu
Get to know linux - First steps with Ubuntu
 
Ada Lovelace Day 2015 - Privacy in the Age of Surveillance
Ada Lovelace Day 2015 - Privacy in the Age of SurveillanceAda Lovelace Day 2015 - Privacy in the Age of Surveillance
Ada Lovelace Day 2015 - Privacy in the Age of Surveillance
 
Master Blender Shortcuts
Master Blender ShortcutsMaster Blender Shortcuts
Master Blender Shortcuts
 
[SI] Kako prijeti WordPress za roge? - Delavnica Wordpress osnove
[SI] Kako prijeti WordPress za roge? - Delavnica Wordpress osnove[SI] Kako prijeti WordPress za roge? - Delavnica Wordpress osnove
[SI] Kako prijeti WordPress za roge? - Delavnica Wordpress osnove
 
[EN] Ada Lovelace Day 2014 - Tampon run
[EN] Ada Lovelace Day 2014  - Tampon run[EN] Ada Lovelace Day 2014  - Tampon run
[EN] Ada Lovelace Day 2014 - Tampon run
 
[SI] Ada Lovelace Day 2014 - Tampon Run
[SI] Ada Lovelace Day 2014  - Tampon Run[SI] Ada Lovelace Day 2014  - Tampon Run
[SI] Ada Lovelace Day 2014 - Tampon Run
 

Kürzlich hochgeladen

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Kürzlich hochgeladen (20)

Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 

Prižiganje lučk z Arduinom