Arduino
Z MediaWiki SPŠ a VOŠ Písek
(Rozdíly mezi verzemi)
(→Examples 2) |
(→What is available...) |
||
(Není zobrazeno 20 mezilehlých verzí od 1 uživatele.) | |||
Řádka 29: | Řádka 29: | ||
Sestavy: | Sestavy: | ||
<Gallery> | <Gallery> | ||
− | Soubor:arduino_KNP.jpg|[ | + | Soubor:arduino_KNP.jpg|[https://en.wikipedia.org/wiki/ATmega328 ATmega328] + bootloader [http://uart.cz/452/arduino-na-nepajivem-poli/ Návod] [http://www.xappsoftware.com/wordpress/2012/04/16/how-to-upload-sketches-to-arduino-uno-chip-using-pl2303-usb-to-rs-232-converter/ How to using PL2303] |
Soubor:Arduino_Nanino.jpg|[http://vonkonow.com/wordpress/2012/10/nanino-the-diy-friendly-arduino/ Nanino] + [http://goo.gl/J8zTA7 CP2104 s DTR] | Soubor:Arduino_Nanino.jpg|[http://vonkonow.com/wordpress/2012/10/nanino-the-diy-friendly-arduino/ Nanino] + [http://goo.gl/J8zTA7 CP2104 s DTR] | ||
− | Soubor: | + | Soubor:Atmega328-sch.png |
</Gallery> | </Gallery> | ||
Řádka 59: | Řádka 59: | ||
<gallery> | <gallery> | ||
Soubor:Arduino_blink.jpg|[http://blog.ardublock.com/ ArduBlock] | Soubor:Arduino_blink.jpg|[http://blog.ardublock.com/ ArduBlock] | ||
− | Soubor:123d.jpg|[ | + | Soubor:123d.jpg|[https://www.tinkercad.com/ tinkercad - web Arduino IDE] |
Soubor:simulide.jpg|[http://sourceforge.net/projects/simulide/ SimulIDE] | Soubor:simulide.jpg|[http://sourceforge.net/projects/simulide/ SimulIDE] | ||
Soubor:Code-Blocks.png|[http://www.arduinodev.com/codeblocks/ CodeBlocks - web Arduino IDE] | Soubor:Code-Blocks.png|[http://www.arduinodev.com/codeblocks/ CodeBlocks - web Arduino IDE] | ||
Řádka 108: | Řádka 108: | ||
+ | == Arduino Shield by SPŠ == | ||
+ | <Gallery> | ||
+ | Soubor:arduino_shield_UNI.jpg | ||
+ | </Gallery> | ||
== www == | == www == | ||
Řádka 142: | Řádka 146: | ||
[http://www.instructables.com/id/Make-your-own-arduino-serverino/?ALLSTEPS Make your own arduino serverino] | [http://www.instructables.com/id/Make-your-own-arduino-serverino/?ALLSTEPS Make your own arduino serverino] | ||
+ | |||
+ | [https://www.youtube.com/watch?v=3imfP2TZbNc Arduino Voice Control using Smartphone] | ||
== Shield == | == Shield == | ||
Řádka 156: | Řádka 162: | ||
Soubor:8-LED.jpg|[http://goo.gl/cnKXhz 8 Channels Flowing Water Light LED] | Soubor:8-LED.jpg|[http://goo.gl/cnKXhz 8 Channels Flowing Water Light LED] | ||
− | Soubor:ht1632c.jpg|[ | + | Soubor:ht1632c.jpg|[https://www.instructables.com/User-Manual-MAX7219-Dot-Matrix-4-in-1/ MAX7219 Matrix Display] |
</gallery> | </gallery> | ||
− | === | + | === What is available... === |
<gallery> | <gallery> | ||
+ | Soubor:Multifunctional Expansion Board.png|[[:Soubor:MFEB-schematic.png|schéma]] [[:Soubor:MFEB-example.pdf|příklady]] | ||
Soubor:Arduino-Ethernet.jpg|[http://arduino.cc/en/Main/ArduinoEthernetShield Arduino Ethernet Shield W5100 + microSD]|[http://arduino.cc/en/Reference/Ethernet knihovna] | Soubor:Arduino-Ethernet.jpg|[http://arduino.cc/en/Main/ArduinoEthernetShield Arduino Ethernet Shield W5100 + microSD]|[http://arduino.cc/en/Reference/Ethernet knihovna] | ||
Soubor:USB_UART_TTL_CH340.png|USB převodník UART TTL s čipem CH340 | Soubor:USB_UART_TTL_CH340.png|USB převodník UART TTL s čipem CH340 | ||
Řádka 194: | Řádka 201: | ||
Soubor:Mini_SD_AD4_Audio.png|[http://www.buildcircuit.com/example-1-using-wtv020sd-16p-music-module-with-arduino/ Mini SD AD4 Audio Přehrávač] | Soubor:Mini_SD_AD4_Audio.png|[http://www.buildcircuit.com/example-1-using-wtv020sd-16p-music-module-with-arduino/ Mini SD AD4 Audio Přehrávač] | ||
− | Soubor:Adresovatelna_RGB_LED_5V_SMD.png|[http://www. | + | Soubor:Adresovatelna_RGB_LED_5V_SMD.png|[http://www.instructables.com/id/Best-RGB-LEDs-for-any-project-WS2812/?ALLSTEPS Adresovatelná RGB LED 5V SMD WS2812] |
Soubor:Adresovatelna_RGB_deska_3xLED_12V.png|[http://www.adafruit.com/datasheets/WS2811.pdf Adresovatelná_RGB deska 3xLED 12V WS2811] | Soubor:Adresovatelna_RGB_deska_3xLED_12V.png|[http://www.adafruit.com/datasheets/WS2811.pdf Adresovatelná_RGB deska 3xLED 12V WS2811] | ||
Soubor:Arduino_gyroskop_akcelerometr.png|[http://invensense.com/mems/gyro/documents/PS-MPU-6000A.pdf Gyroskop akcelerometr MPU-6050 I2C] | Soubor:Arduino_gyroskop_akcelerometr.png|[http://invensense.com/mems/gyro/documents/PS-MPU-6000A.pdf Gyroskop akcelerometr MPU-6050 I2C] | ||
Řádka 202: | Řádka 209: | ||
Soubor:Matrix8x8-Arduino.png|[http://www.gme.cz/led-display-maticovy-32x32mm-rg-hd-m10eg88md-p512-178 GME.cz] [http://arduino-er.blogspot.cz/2015/02/beating-heart-animation-on-8x8-led.html 8x8 LED Matrix] [http://www.instructables.com/id/Intermediate-Arduino-Inputs-and-Outputs/?ALLSTEPS] | Soubor:Matrix8x8-Arduino.png|[http://www.gme.cz/led-display-maticovy-32x32mm-rg-hd-m10eg88md-p512-178 GME.cz] [http://arduino-er.blogspot.cz/2015/02/beating-heart-animation-on-8x8-led.html 8x8 LED Matrix] [http://www.instructables.com/id/Intermediate-Arduino-Inputs-and-Outputs/?ALLSTEPS] | ||
Soubor:RGB-LED.png|RGB LED Strip | Soubor:RGB-LED.png|RGB LED Strip | ||
− | Soubor:Arduino-Full-Color-RGB.jpg|[ | + | Soubor:Arduino-Full-Color-RGB.jpg|[https://www.instructables.com/LED-Multiplexing-101-6-and-16-RGB-LEDs-With-Just-a/ Full Color RGB 8-SMD 5050 LED Module] |
+ | Soubor:WeMOS D1.png|[http://educ8s.tv/esp8266-ota-wemos-d1/ WeMOS D1] | ||
+ | Soubor:MEMSIC_2125.png|[https://www.parallax.com/product/28017 MEMSIC 2125 Dual-axis Accelerometer] | ||
+ | Soubor:H48C.png|[https://itp.nyu.edu/archive/physcomp-spring2014/sensors/Reports/H48C.html H48C - 3 Axis Accelerometer] | ||
+ | Soubor:ACS712.png|[https://www.electronicshub.org/interfacing-acs712-current-sensor-with-arduino/ Proudový senzor 30A ACS712] | ||
</gallery> | </gallery> | ||
Řádka 213: | Řádka 224: | ||
# Jedním tlačítkem LED zhasne a jiným se rozsvítí | # Jedním tlačítkem LED zhasne a jiným se rozsvítí | ||
− | [[Soubor:Button-LED.png|200px]] | + | ==== Test tlačítka ==== |
+ | [[Soubor:Button-LED.png|200px|right]] | ||
<source lang"Csharp"> | <source lang"Csharp"> | ||
Řádka 230: | Řádka 242: | ||
<source lang"Csharp"> | <source lang"Csharp"> | ||
const int buttonPin = 2; // | const int buttonPin = 2; // | ||
− | const int ledPin = | + | const int ledPin = 8; // |
int buttonState = 0; // variable | int buttonState = 0; // variable | ||
Řádka 250: | Řádka 262: | ||
</source> | </source> | ||
− | [[Soubor:Test-traffic-light.png| | + | ==== Traffic light ==== |
+ | |||
+ | [[Soubor:Test-traffic-light.png|200px|right]] | ||
<source lang="csharp"> | <source lang="csharp"> | ||
int pin; | int pin; | ||
Řádka 276: | Řádka 290: | ||
</source> | </source> | ||
+ | ==== DC motor ==== | ||
− | [[Soubor:L298N_Arduino_DC_Motor_H-Mustek.png| | + | [[Soubor:L298N_Arduino_DC_Motor_H-Mustek.png|200px|right]] |
<source lang="csharp"> | <source lang="csharp"> | ||
int MotorL1 = 3; | int MotorL1 = 3; | ||
Řádka 306: | Řádka 321: | ||
</source> | </source> | ||
+ | ==== RGB ==== | ||
− | [[Soubor:RGB-LED.png| | + | [[Soubor:RGB-LED.png|200px|right]] |
<source lang="csharp"> | <source lang="csharp"> | ||
Řádka 337: | Řádka 353: | ||
</source> | </source> | ||
− | [[Soubor:HC-SR04-ultrasonic.png| | + | ==== SR04 ultrasonic ==== |
+ | |||
+ | [[Soubor:HC-SR04-ultrasonic.png|200px|right]] | ||
<source lang="Csharp"> | <source lang="Csharp"> | ||
Řádka 365: | Řádka 383: | ||
</source> | </source> | ||
− | [[Soubor:servo.png| | + | ==== Servo ==== |
+ | |||
+ | [[Soubor:servo.png|200px|right]] | ||
<source lang"Csharp"> | <source lang"Csharp"> | ||
#include <Servo.h> | #include <Servo.h> | ||
Řádka 392: | Řádka 412: | ||
</source> | </source> | ||
+ | ==== RBT servo ==== | ||
− | [[Soubor:servo_2.png| | + | [[Soubor:servo_2.png|200px|right]] |
<source lang"Csharp"> | <source lang"Csharp"> |
Aktuální verze z 11. 6. 2021, 10:28
Arduino | |
|
Obsah |
Vývoj MIT aplikace s Arduino:
What we needs:
Sestavy:
ATmega328 + bootloader Návod How to using PL2303
Examples
/* Blink * http://www.arduino.cc/en/Tutorial/Blink */ int ledPin = 13; // LED je připojena na pin 13 void setup(){ // tato část proběhne jednou po startu pinMode(ledPin, OUTPUT); // nastaví pin jako výstupní } void loop(){ // procedura digitalWrite(ledPin, HIGH); // rozsvícení LED delay(1000); // pauza 1s digitalWrite(ledPin, LOW); // zhasnutí LED delay(1000); // pauza 1s }
Tools:
- .hex you can find in c:\Users\*\Local Settings\Temp\build*.tmp\*.hex
Tutorials:
Aplikace s Arduino
ARD07 LED Cube
ARD05 B4short s L293 + ping [1]
Videa
Experimenty
- Arduiono-robot-pepik.jpg
- Arduino-spsavos.jpg
- Arduino-pocitadlo.jpg
Arduino Shield by SPŠ
- Arduino shield UNI.jpg
www
Arduino a PICAXE na Windows 8 64-bit
advance
Arduino IDE for programming Atmega Microcontrollers
How to program Arduino by using USBasp without bootloader
Building an Arduino on a Breadboard
Serial connection for your Arduino / Atmega
Basic Minimal Arduino Without Crystal
Burning the Bootloader on ATMega328 using Arduino UNO as ISP
USBASP Bootloading a ATMega328p with a 8MHz internal clock
Make your own arduino serverino
Arduino Voice Control using Smartphone
Shield
LoL Shield věnovaný sponzorem školy: jitenkaa, (zde je možné stavebnici objednat)
What is available...
Examples 2
- LED bliká v Morseově abecedě SOS ( . . . - - - . . . ) s opakováním s časovým odstupem 4 sekundy
- 8 LED bliká dle pravdivostní tabulky tak, aby svítala v daném čase postupně jen jedna LED (had)
- Aktivací tlačítka LED, která předtím svítila zhasne
- Každým zmáčknutím tlačítka se změní stav LED na opačný
- Jedním tlačítkem LED zhasne a jiným se rozsvítí
Test tlačítka
void setup() { pinMode( 2, INPUT_PULLUP); pinMode( 8, OUTPUT); } void loop() { digitalWrite( 8 , !digitalRead(2) ); }
const int buttonPin = 2; // const int ledPin = 8; // int buttonState = 0; // variable void setup() { pinMode(ledPin, OUTPUT); pinMode(buttonPin, INPUT); } void loop() { buttonState = digitalRead(buttonPin); if (buttonState == HIGH) { digitalWrite(ledPin, HIGH); } else { digitalWrite(ledPin, LOW); } }
Traffic light
int pin; void setup() { for (int i=4; i <= 13; i++){ pinMode(i, OUTPUT); } } void blik(int pin) { digitalWrite(pin, LOW); delay(500); digitalWrite(pin, HIGH); } void loop() { for (int i=4; i <= 13; i++){ blik(i); } }
DC motor
int MotorL1 = 3; int MotorL2 = 11; int MotorR1 = 5; int MotorR2 = 6; void loop() { MotorForward(); delay(2000); TurnLeft(); delay(2000); } void MotorForward() { digitalWrite(MotorL1, LOW); // digitalWrite(MotorL2, HIGH); // digitalWrite(MotorR1, LOW); // digitalWrite(MotorR2, HIGH); // } void TurnLeft() { analogWrite(MotorL1, LOW); // analogWrite(MotorL2, 128); // analogWrite(MotorR1, 128); // digitalWrite(MotorR2, LOW); // }
RGB
..... void loop() { setColor(255, 0, 0); // red delay(1000); setColor(0, 255, 0); // green delay(1000); setColor(0, 0, 255); // blue delay(1000); setColor(255, 255, 0); // red + green delay(1000); setColor(255, 0, 255); // red + blue delay(1000); setColor(0, 255, 255); // green + blue delay(1000); } void setColor(int red, int green, int blue) { analogWrite(redPin, red); analogWrite(greenPin, green); analogWrite(bluePin, blue); }
SR04 ultrasonic
#define trigPin 8 #define echoPin 9 void setup() { Serial.begin (9600); pinMode(trigPin, OUTPUT); pinMode(echoPin, INPUT); } void loop() { long duration, distance; digitalWrite(trigPin, LOW); delayMicroseconds(2); // digitalWrite(trigPin, HIGH); delayMicroseconds(10); // digitalWrite(trigPin, LOW); duration = pulseIn(echoPin, HIGH); distance = (duration/2) / 29.1; Serial.print(distance); Serial.println(" cm"); delay(500); }
Servo
#include <Servo.h> Servo myservo; int pos = 0; void setup() { myservo.attach(6); Serial.begin (9600); } void loop() { for (pos = 0; pos <= 180; pos += 1) { myservo.write(pos); Serial.println(pos); delay(20); } for (pos = 180; pos >= 0; pos -= 1) { myservo.write(pos); Serial.println(pos); delay(20); } }
RBT servo
#include <Servo.h> // Include servo library Servo servoLeft; // Declare left servo signal unsigned char motion = 0; void setup() // Built in initialization block { pinMode(5,INPUT_PULLUP); pinMode(6,INPUT_PULLUP); pinMode(7,INPUT_PULLUP); pinMode(2,OUTPUT); pinMode(3,OUTPUT); pinMode(4,OUTPUT); pinMode(9,OUTPUT); servoLeft.attach(9); // Serial.begin (9600); } void loop() { motion = digitalRead(5) + digitalRead(6)*2 + digitalRead(7)*4; Serial.print(motion); Serial.println(""); switch(motion) { case 0b00000110: servoLeft.write(30); digitalWrite(4,HIGH); digitalWrite(3,HIGH); digitalWrite(2,LOW); break; case 0b00000101: servoLeft.write(60); digitalWrite(4,HIGH); digitalWrite(3,LOW); digitalWrite(2,HIGH); break; case 0b00000011: servoLeft.write(90); digitalWrite(4,LOW); digitalWrite(3,HIGH); digitalWrite(2,HIGH); break; case 0b00000111: servoLeft.write(120); digitalWrite(4,HIGH); digitalWrite(3,HIGH); digitalWrite(2,HIGH); break; delay(15); } }