cbduino
TRANSCRIPT
![Page 1: CBduino](https://reader030.vdocuments.pub/reader030/viewer/2022013111/55a1a9161a28abf31e8b46ad/html5/thumbnails/1.jpg)
CBduino CBduino geocaching eventgeocaching event
Kuba76, Owar, McHaKuba76, Owar, McHa
GC4DJMBGC4DJMBGC4DJMBGC4DJMBGC4DJMBGC4DJMBGC4DJMBGC4DJMBGC4DJMBGC4DJMB
![Page 2: CBduino](https://reader030.vdocuments.pub/reader030/viewer/2022013111/55a1a9161a28abf31e8b46ad/html5/thumbnails/2.jpg)
Arduino: Digital and Arduino: Digital and Analog pinsAnalog pins
![Page 3: CBduino](https://reader030.vdocuments.pub/reader030/viewer/2022013111/55a1a9161a28abf31e8b46ad/html5/thumbnails/3.jpg)
Pull-up Pull-downPull-up Pull-down
![Page 4: CBduino](https://reader030.vdocuments.pub/reader030/viewer/2022013111/55a1a9161a28abf31e8b46ad/html5/thumbnails/4.jpg)
Digitální vstupDigitální vstup
Nastavení pinu jako vstup Připojení pull-up/down rezistoru Nastavení integrovaného pull-down rezistoru Čtení stavu pinu-stav 0 nebo 1
pinMode(pin, INPUT); // Set the pin to inputdigitalWrite(pin, HIGH); // turn on pullup resistorsdigitalRead(pin);//Read the state of input
![Page 5: CBduino](https://reader030.vdocuments.pub/reader030/viewer/2022013111/55a1a9161a28abf31e8b46ad/html5/thumbnails/5.jpg)
Digitální výstupDigitální výstup
Nastavení pinu jako výstup Nastavení stavu pinu-stav 0 nebo 1
pinMode(pin, OUTPUT); // Set the pin to outputdigitalWrite(pin, HIGH); // turn ondigitalWrite(pin, LOW); // turn off
![Page 6: CBduino](https://reader030.vdocuments.pub/reader030/viewer/2022013111/55a1a9161a28abf31e8b46ad/html5/thumbnails/6.jpg)
Analogový vstupAnalogový vstup
Nastavení pinu jako vstup Připojení pull-up/down rezistoru Nastavení integrovaného pull-down rezistoru Čtení stavu pinu- stav 0 až 1023
pinMode(pin, INPUT); // Set the pin to inputdigitalWrite(pin, HIGH); // turn on pullup resistorsanalogRead(pin); // Read the state of input
![Page 7: CBduino](https://reader030.vdocuments.pub/reader030/viewer/2022013111/55a1a9161a28abf31e8b46ad/html5/thumbnails/7.jpg)
Analogový výstupAnalogový výstup
Nastavení pinu jako výstup Nastavení stavu pinu- stav 0 až 255
pinMode(pin, OUTPUT); // Set the pin to outputanalogWrite(pin,STATE); // Read the state of input
![Page 8: CBduino](https://reader030.vdocuments.pub/reader030/viewer/2022013111/55a1a9161a28abf31e8b46ad/html5/thumbnails/8.jpg)
PWMPWM
Pulzně Šířková Modulace(Pulse Width Modulation)
![Page 9: CBduino](https://reader030.vdocuments.pub/reader030/viewer/2022013111/55a1a9161a28abf31e8b46ad/html5/thumbnails/9.jpg)
WIRINGWIRING
void setup() { // put your setup code here, to run once:
}
void loop() { // put your main code here, to run repeatedly: }
![Page 10: CBduino](https://reader030.vdocuments.pub/reader030/viewer/2022013111/55a1a9161a28abf31e8b46ad/html5/thumbnails/10.jpg)
WIRINGWIRINGpinMode(pin, INPUT); digitalWrite(pin, STATE); //STATE: LOW/HIGH digitalRead(pin);analogWrite(pin, STATE); //STATE: 0-255analogRead(pin); delay(X); X=time of delay in milisecondsmillis();
![Page 11: CBduino](https://reader030.vdocuments.pub/reader030/viewer/2022013111/55a1a9161a28abf31e8b46ad/html5/thumbnails/11.jpg)
VýstupyVýstupy
grafické
•fyzické
•zvukové
![Page 12: CBduino](https://reader030.vdocuments.pub/reader030/viewer/2022013111/55a1a9161a28abf31e8b46ad/html5/thumbnails/12.jpg)
LED - blinkLED - blink
int led = 13;void setup() { pinMode(led, OUTPUT); }void loop() { digitalWrite(led, HIGH); delay(1000); digitalWrite(led, LOW); delay(1000); }
![Page 13: CBduino](https://reader030.vdocuments.pub/reader030/viewer/2022013111/55a1a9161a28abf31e8b46ad/html5/thumbnails/13.jpg)
LCD - displayLCD - display
simulator @ http://www.dinceraydin.com/djlcdsim/djlcdsim.htmlchip Hitachi HD44780
Libraries - knihovny (system, uživatel)
#include <LiquidCrystal.h>
![Page 14: CBduino](https://reader030.vdocuments.pub/reader030/viewer/2022013111/55a1a9161a28abf31e8b46ad/html5/thumbnails/14.jpg)
VstupyVstupy
sensory všeho druhu
![Page 15: CBduino](https://reader030.vdocuments.pub/reader030/viewer/2022013111/55a1a9161a28abf31e8b46ad/html5/thumbnails/15.jpg)
KomunikaceKomunikace I²C - (Inter-Integrated Circuit protocol) - Philips (~TWI) SDA, SCL - adresy #include <Wire.h> Uno: A4 (SDA), A5 (SCL) // Mega2560: 20 (SDA), 21 (SCL)
SPI - (Serial Peripheral Interface) - Motorola MISO, MOSI, SCLK, SS - master/slave #include <SPI.h> MOSI, MISO, SCK, SS - Uno: 11,12,13,10 // Mega2560: 51,50,52,53
Ethernet - shield Wireless .... serial modem xBee, Wi-Fi, BT, RF 443MHz
![Page 16: CBduino](https://reader030.vdocuments.pub/reader030/viewer/2022013111/55a1a9161a28abf31e8b46ad/html5/thumbnails/16.jpg)
Kde hledat informaceKde hledat informace
- Datasheet, datasheet, datasheet, datasheet - manuál, manuál, manuál www.arduino.cc playground, forum
www.4makers.info
![Page 17: CBduino](https://reader030.vdocuments.pub/reader030/viewer/2022013111/55a1a9161a28abf31e8b46ad/html5/thumbnails/17.jpg)
Bread boardBread board
- nepájivé pole