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
Prižiganje lučk z Arduinom
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

More Related Content

PDF
DIY UNO Play Breadboard ATMEGA328P with FT232 Breakout Board
PDF
Ardublock tutorial
PPTX
Arduino Day 1 Presentation
PDF
Arduino electronics cookbook
PPTX
Getting started with arduino workshop
PDF
Presentation S4A
PDF
Arduino spooky projects_class1
ODP
Arduino boards
DIY UNO Play Breadboard ATMEGA328P with FT232 Breakout Board
Ardublock tutorial
Arduino Day 1 Presentation
Arduino electronics cookbook
Getting started with arduino workshop
Presentation S4A
Arduino spooky projects_class1
Arduino boards

What's hot (19)

PPTX
Arduino tutorial A to Z
PDF
Intro to-the-arduino
PDF
Arduino
PDF
Apostila arduino
PPTX
Capabilities of Arduino (including Due)
PPTX
Arduino
PPTX
Mom presentation_monday_arduino in the physics lab
PPT
Arduino Introduction by coopermaa
PPTX
Arduino Workshop Day 2
PPTX
1.Arduino Ecosystem.pptx
ODP
Arduino
PPTX
Powerful Electronics with Arduino
PPTX
Basics of arduino uno
PPTX
What are the different types of arduino boards
PDF
Introduction to Arduino
PPTX
Introduction to arduino ppt main
PPTX
SMART LAMP WITH A GSM MODULE SIM 800 L
PPTX
Smart Lamp With a GSM Module SIM800L
Arduino tutorial A to Z
Intro to-the-arduino
Arduino
Apostila arduino
Capabilities of Arduino (including Due)
Arduino
Mom presentation_monday_arduino in the physics lab
Arduino Introduction by coopermaa
Arduino Workshop Day 2
1.Arduino Ecosystem.pptx
Arduino
Powerful Electronics with Arduino
Basics of arduino uno
What are the different types of arduino boards
Introduction to Arduino
Introduction to arduino ppt main
SMART LAMP WITH A GSM MODULE SIM 800 L
Smart Lamp With a GSM Module SIM800L
Ad

Similar to Prižiganje lučk z Arduinom (20)

DOCX
Simply arduino
PPT
arduinoSimon.ppt
PPT
arduinoSimon.ppt
PPT
arduinoSimon.ppt
PDF
P-Space Arduino/Genuino day 2016
PPT
arduino Simon power point presentation.ppt
PPSX
Arduino اردوينو
PDF
Lab 2_ Programming an Arduino.pdf
PDF
2015-10-21 - Arduino workshop
PPT
arduino.ppt
PDF
Arduino: Intro and Digital I/O
PPTX
Arduino Introduction PPT for school students
PPTX
Arduino basics & programming skill development
PPTX
Arduino . .
PPTX
Internet of thing: Trabajando con Arduino y Visual Studio
PPTX
Magnetic door lock using arduino
PPTX
arduino simulators OR microcontroller.pptx
PPTX
Lecture2- Smart Parking Assistant using Arduino
PPTX
Arduino intro.pptx
PPTX
Introduction to Arduino
Simply arduino
arduinoSimon.ppt
arduinoSimon.ppt
arduinoSimon.ppt
P-Space Arduino/Genuino day 2016
arduino Simon power point presentation.ppt
Arduino اردوينو
Lab 2_ Programming an Arduino.pdf
2015-10-21 - Arduino workshop
arduino.ppt
Arduino: Intro and Digital I/O
Arduino Introduction PPT for school students
Arduino basics & programming skill development
Arduino . .
Internet of thing: Trabajando con Arduino y Visual Studio
Magnetic door lock using arduino
arduino simulators OR microcontroller.pptx
Lecture2- Smart Parking Assistant using Arduino
Arduino intro.pptx
Introduction to Arduino
Ad

More from Maja Kraljič (12)

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

Recently uploaded (20)

PDF
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
PDF
August Patch Tuesday
PDF
Five Habits of High-Impact Board Members
PPT
What is a Computer? Input Devices /output devices
PDF
Hindi spoken digit analysis for native and non-native speakers
PDF
sustainability-14-14877-v2.pddhzftheheeeee
PDF
Enhancing emotion recognition model for a student engagement use case through...
PPT
Module 1.ppt Iot fundamentals and Architecture
PDF
Hybrid horned lizard optimization algorithm-aquila optimizer for DC motor
PPTX
observCloud-Native Containerability and monitoring.pptx
PDF
DP Operators-handbook-extract for the Mautical Institute
PDF
Univ-Connecticut-ChatGPT-Presentaion.pdf
PDF
A Late Bloomer's Guide to GenAI: Ethics, Bias, and Effective Prompting - Boha...
PDF
WOOl fibre morphology and structure.pdf for textiles
PDF
Zenith AI: Advanced Artificial Intelligence
PDF
A novel scalable deep ensemble learning framework for big data classification...
PDF
Unlock new opportunities with location data.pdf
PPTX
Tartificialntelligence_presentation.pptx
PPTX
Benefits of Physical activity for teenagers.pptx
PDF
A contest of sentiment analysis: k-nearest neighbor versus neural network
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
August Patch Tuesday
Five Habits of High-Impact Board Members
What is a Computer? Input Devices /output devices
Hindi spoken digit analysis for native and non-native speakers
sustainability-14-14877-v2.pddhzftheheeeee
Enhancing emotion recognition model for a student engagement use case through...
Module 1.ppt Iot fundamentals and Architecture
Hybrid horned lizard optimization algorithm-aquila optimizer for DC motor
observCloud-Native Containerability and monitoring.pptx
DP Operators-handbook-extract for the Mautical Institute
Univ-Connecticut-ChatGPT-Presentaion.pdf
A Late Bloomer's Guide to GenAI: Ethics, Bias, and Effective Prompting - Boha...
WOOl fibre morphology and structure.pdf for textiles
Zenith AI: Advanced Artificial Intelligence
A novel scalable deep ensemble learning framework for big data classification...
Unlock new opportunities with location data.pdf
Tartificialntelligence_presentation.pptx
Benefits of Physical activity for teenagers.pptx
A contest of sentiment analysis: k-nearest neighbor versus neural network

Prižiganje lučk z Arduinom