Здесь показаны различия между двумя версиями данной страницы.
Предыдущая версия справа и слева Предыдущая версия Следующая версия | Предыдущая версия | ||
arduino_2017 [2017/12/17 16:48] super_admin [Наборы для изучения принципов создания киберфизических устройств на Arduino] |
arduino_2017 [2019/06/24 20:29] (текущий) |
||
---|---|---|---|
Строка 1: | Строка 1: | ||
====== Микропроцессорная плата Arduino ====== | ====== Микропроцессорная плата Arduino ====== | ||
+ | |||
+ | |||
+ | |||
+ | ===== Справочные материалы по программированию Arduino ===== | ||
+ | |||
+ | * [[https://yadi.sk/i/5CMqjaQX3Qr3Ns | Справочник по языку программирования для Arduino (*.pdf)]] | ||
+ | * [[https://yadi.sk/i/B4dNTU4g3Qr3hQ | Arduino - быстрый старт (учебное пособие *.pdf)]] | ||
Строка 61: | Строка 68: | ||
* [[https://youtu.be/J8XNTHETgxU]] - | * [[https://youtu.be/J8XNTHETgxU]] - | ||
+ | |||
+ | ==== Сирена на Arduino ==== | ||
+ | |||
+ | |||
+ | * http://pzlezioniesercizionline.blogspot.ru/2015/10/tutorial-arduino-come-realizzare-la.html | ||
+ | |||
+ | {{::schema_sirena.jpg|}} | ||
+ | |||
+ | <code c> | ||
+ | |||
+ | Ecco lo sketch: | ||
+ | |||
+ | // Sirena della Polizia | ||
+ | |||
+ | int wait= 1; | ||
+ | int time =10; | ||
+ | int freq = 0; | ||
+ | int ledPin1 =2; | ||
+ | int ledPin2 =3; | ||
+ | int tonePin =8; | ||
+ | |||
+ | void setup(){ | ||
+ | pinMode(ledPin1, OUTPUT); | ||
+ | pinMode(ledPin2, OUTPUT); | ||
+ | } | ||
+ | |||
+ | void loop() { | ||
+ | for (freq = 160; freq < 1700; freq += 1) { // valore iniziale, valore limite high, incremento | ||
+ | tone(tonePin, freq, time); // Pin del piezo, frequenza, durata | ||
+ | digitalWrite(ledPin1,LOW); | ||
+ | digitalWrite(ledPin2,HIGH); | ||
+ | delay(wait); | ||
+ | } | ||
+ | for (freq = 1700; freq > 160; freq -= 1) {// valore iniziale, valore limite low, decremento | ||
+ | tone(tonePin, freq, time); | ||
+ | digitalWrite(ledPin1,HIGH); | ||
+ | digitalWrite(ledPin2,LOW); | ||
+ | delay(wait); | ||
+ | } | ||
+ | } | ||
+ | |||
+ | </code> | ||
+ | |||
+ | |||
+ | **Замена delay() для неблокирующих задержек в Arduino IDE** | ||
+ | |||
+ | https://habrahabr.ru/post/319184/ | ||
+ | |||
+ | https://github.com/nw-wind/SmartDelay | ||
+ | |||
+ | ==== ШАГОВЫЙ ДВИГАТЕЛЬ ==== | ||
+ | |||
+ | * https://github.com/simonmonk/raspirobotboard3/issues/17 | ||
+ | * https://www.youtube.com/watch?v=jJQwmnyfw5k | ||
+ | * https://youtu.be/Twgogd93x2c | ||
+ | * https://lesson.iarduino.ru/page/upravlenie-shagovym-dvigatelem-s-arduiny/ | ||
+ | * http://arduino-diy.com/arduino-shagovii-motor-28-BYJ48-draiver-ULN2003 | ||
+ | * http://arduino-diy.com/arduino-shagovyy-dvigatel-osnovy | ||
+ | * http://robotosha.ru/arduino/stepper-motor-28byj-uln2003-arduino.html | ||
+ | * [[http://codius.ru/articles/Arduino_Uno_%D1%88%D0%B0%D0%B3%D0%BE%D0%B2%D1%8B%D0%B9_%D0%B4%D0%B2%D0%B8%D0%B3%D0%B0%D1%82%D0%B5%D0%BB%D1%8C_28BYJ_48_5V_%D0%B4%D1%80%D0%B0%D0%B9%D0%B2%D0%B5%D1%80_ULN2003_%D0%BD%D0%B0_%D0%BC%D0%BE%D0%B4%D1%83%D0%BB%D0%B5_SBT0811 | Arduino Uno + шаговый двигатель 28BYJ-48 (5V) + драйвер ULN2003 (на модуле SBT0811)]] | ||
+ | * | ||
+ | |||
+ | |||
+ | |||
+ | |||
==== Полезные ссылки ==== | ==== Полезные ссылки ==== | ||
Строка 78: | Строка 150: | ||
[[http://dvrobot.ru/240/286/341/747.html]] | [[http://dvrobot.ru/240/286/341/747.html]] | ||
+ | ===== Операционный усилитель LM358 ===== | ||
+ | |||
+ | * [[http://www.joyta.ru/5934-opisanie-i-primenenie-operacionnogo-usilitelya-lm358/]] - Описание и применение операционного усилителя LM358. Схемы включения, аналог, datasheet | ||
+ | * [[http://cxem.net/beginner/beginner96.php]] Операционный усилитель? Это очень просто! | ||
+ | * [[http://usamodelkina.ru/7899-prostoy-analogovyy-datchik-zvuka-dlya-arduino-svoimi-rukami.html]] **Простой аналоговый датчик звука для Ардуино своими руками** | ||
+ | * [[https://myrobot.ru/forum/topic.php?forum=9&topic=126]] - микрофонный усилитель на LM358 | ||
+ | * [[http://cxem.net/arduino/arduino146.php]] RGB светодиодная подсветка для пианино | ||
+ | * [[http://chipmk.ru/index.php/12-izmerenie/160-prostoj-usilitel-termopary]] Простой усилитель термопары | ||
+ | * [[http://arduino.ru/forum/apparatnye-voprosy/milliampermetr-na-arduino]] Миллиамперметр на Ардуино. | ||
+ | * http://radioded.ru/proekty-na-arduino - распознавание голоса | ||
+ | |||
+ | |||
+ | |||
+ | * [[http://www.st.com/content/ccc/resource/technical/document/datasheet/61/46/87/01/98/ed/44/c5/CD00000464.pdf/files/CD00000464.pdf/jcr:content/translations/en.CD00000464.pdf]] - datasheet | ||
+ | |||
+ | * [[http://www.promelec.ru/catalog_info/54/134/541/331/]] - микрофоны | ||
+ | |||
+ | * https://geektimes.ru/post/268036/ - Делаем включение ПК по хлопку за вечер | ||
+ | * http://cxem.net/arduino/arduino146.php - RGB светодиодная подсветка для пианино | ||
+ | * http://www.instructables.com/id/RGB-LED-Piano-Lights/ | ||
+ | * https://usamodelkina.ru/7899-prostoy-analogovyy-datchik-zvuka-dlya-arduino-svoimi-rukami.html | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ==== Усилитель НЧ D-класс 2.1, 2х50Вт, 1x100Вт (TPA3116) ==== | ||
+ | |||
+ | |||
+ | https://www.electronshik.ru/item/kit-mp3117box-2564174 | ||
+ | |||
+ | <code> | ||
+ | /* | ||
+ | LiquidCrystal Library - scrollDisplayLeft() and scrollDisplayRight() | ||
+ | |||
+ | Demonstrates the use a 16x2 LCD display. The LiquidCrystal | ||
+ | library works with all LCD displays that are compatible with the | ||
+ | Hitachi HD44780 driver. There are many of them out there, and you | ||
+ | can usually tell them by the 16-pin interface. | ||
+ | |||
+ | This sketch prints "Hello World!" to the LCD and uses the | ||
+ | scrollDisplayLeft() and scrollDisplayRight() methods to scroll | ||
+ | the text. | ||
+ | |||
+ | The circuit: | ||
+ | * LCD RS pin to digital pin 12 | ||
+ | * LCD Enable pin to digital pin 11 | ||
+ | * LCD D4 pin to digital pin 5 | ||
+ | * LCD D5 pin to digital pin 4 | ||
+ | * LCD D6 pin to digital pin 3 | ||
+ | * LCD D7 pin to digital pin 2 | ||
+ | * LCD R/W pin to ground | ||
+ | * 10K resistor: | ||
+ | * ends to +5V and ground | ||
+ | * wiper to LCD VO pin (pin 3) | ||
+ | |||
+ | Library originally added 18 Apr 2008 | ||
+ | by David A. Mellis | ||
+ | library modified 5 Jul 2009 | ||
+ | by Limor Fried (http://www.ladyada.net) | ||
+ | example added 9 Jul 2009 | ||
+ | by Tom Igoe | ||
+ | modified 22 Nov 2010 | ||
+ | by Tom Igoe | ||
+ | |||
+ | This example code is in the public domain. | ||
+ | |||
+ | http://www.arduino.cc/en/Tutorial/LiquidCrystalScroll | ||
+ | |||
+ | */ | ||
+ | |||
+ | // include the library code: | ||
+ | //#include <LineDriver.h> | ||
+ | #include <LiquidCrystal.h> | ||
+ | //#include <LiquidCrystalRus.h> | ||
+ | //byte bukva_F[8] = {B00100,B11111,B10101,B10101,B11111,B00100,B00100,B00000,}; // Буква "Ф" | ||
+ | // initialize the library with the numbers of the interface pins | ||
+ | LiquidCrystal lcd(13, 12, 11, 10, 9, 8); | ||
+ | |||
+ | void setup() { | ||
+ | // set up the LCD's number of columns and rows: | ||
+ | lcd.begin(16, 2); | ||
+ | // lcd.createChar(9, bukva_F); | ||
+ | // Print a message to the LCD. | ||
+ | lcd.setCursor(0,0); | ||
+ | lcd.print("HOBA\xB1 \xA5H\xAAOPMAT\xA5KA! \xA8""EPE""\xA4""A""\xA1P\xA9\xA4KA!"); | ||
+ | //lcd.print("\xE0\xE1\xE2\xE3\xE4\xE5\xE6"); | ||
+ | //lcd.print("\xA0\xA1\xA2\xA3\xA4\xA5\xA6"); | ||
+ | //lcd.print("\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0"); | ||
+ | //lcd.print(" \xA8 p \xB8 \xB3 e \xBF"); | ||
+ | //lcd.print("xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF/\xE1\xE2\xF7\xE7\xE4\xE5\xF6\xFA\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF2\xF3\xF4\xF5\xE6\xE8\xE3\xFE\xFB\xFD\xFF\xF9\xF8\xFC\xE0\xF1\xC1\xC2\xD7\xC7\xC4\xC5\xD6\xDA\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD2\xD3\xD4\xD5\xC6\xC8\xC3\xDE\xDB\xDD\xDF\xD9\xD8\xDC\xC0\xD1"); | ||
+ | |||
+ | delay(1000); | ||
+ | } | ||
+ | |||
+ | void loop() { | ||
+ | // scroll 13 positions (string length) to the left | ||
+ | // to move it offscreen left: | ||
+ | for (int positionCounter = 0; positionCounter < 30; positionCounter++) { | ||
+ | // scroll one position left: | ||
+ | lcd.scrollDisplayLeft(); | ||
+ | // wait a bit: | ||
+ | delay(300); | ||
+ | } | ||
+ | | ||
+ | /* | ||
+ | // scroll 29 positions (string length + display length) to the right | ||
+ | // to move it offscreen right: | ||
+ | for (int positionCounter = 0; positionCounter < 34; positionCounter++) { | ||
+ | // scroll one position right: | ||
+ | lcd.scrollDisplayRight(); | ||
+ | // wait a bit: | ||
+ | delay(300); | ||
+ | } | ||
+ | |||
+ | // scroll 16 positions (display length + string length) to the left | ||
+ | // to move it back to center: | ||
+ | for (int positionCounter = 0; positionCounter < 16; positionCounter++) { | ||
+ | // scroll one position left: | ||
+ | lcd.scrollDisplayLeft(); | ||
+ | // wait a bit: | ||
+ | delay(300); | ||
+ | } | ||
+ | |||
+ | // delay at the end of the full loop: | ||
+ | delay(300); | ||
+ | */ | ||
+ | } | ||
+ | |||
+ | </code> |