Здесь показаны различия между двумя версиями данной страницы.
Предыдущая версия справа и слева Предыдущая версия Следующая версия | Предыдущая версия Следующая версия Следующая версия справа и слева | ||
practicalwork [2017/03/07 20:54] super_admin [Автоматные модели] |
practicalwork [2017/04/04 20:08] super_admin [LCD дисплей (документация)] |
||
---|---|---|---|
Строка 34: | Строка 34: | ||
[[https://youtu.be/JpcsKiafKZ8]] пример на Youtu.be | [[https://youtu.be/JpcsKiafKZ8]] пример на Youtu.be | ||
+ | ===== Передача данных на Arduino через последовательный порт ===== | ||
+ | |||
+ | <code> | ||
+ | |||
+ | const int R = 11; | ||
+ | const int G = 10; | ||
+ | const int B = 9; | ||
+ | int rval = 0; | ||
+ | int gval = 0; | ||
+ | int bval = 0; | ||
+ | |||
+ | void setup() { | ||
+ | Serial.begin(9600); | ||
+ | pinMode(R, OUTPUT); | ||
+ | pinMode(G, OUTPUT); | ||
+ | pinMode(B, OUTPUT); | ||
+ | Serial.println("ok"); | ||
+ | } | ||
+ | |||
+ | void loop() { | ||
+ | while (Serial.available() > 0){ | ||
+ | rval = Serial.parseInt(); | ||
+ | gval = Serial.parseInt(); | ||
+ | bval = Serial.parseInt(); | ||
+ | |||
+ | if (Serial.read() == '\n'){ | ||
+ | Serial.println(rval); | ||
+ | Serial.println(gval); | ||
+ | Serial.println(bval); | ||
+ | analogWrite(R,rval); | ||
+ | analogWrite(G,gval); | ||
+ | analogWrite(B,bval); | ||
+ | } | ||
+ | } | ||
+ | |||
+ | } | ||
+ | |||
+ | </code> | ||
+ | |||
+ | |||
+ | <code> | ||
+ | |||
+ | PImage img; | ||
+ | Serial port; | ||
+ | |||
+ | void setup() | ||
+ | { | ||
+ | size(800,600); | ||
+ | img = loadImage("rgb_800x600.png"); | ||
+ | port = new Serial(this,"COM7", 9600); | ||
+ | } | ||
+ | |||
+ | void draw() | ||
+ | { | ||
+ | background(0); | ||
+ | image(img,0,0); | ||
+ | | ||
+ | } | ||
+ | |||
+ | void mousePressed() | ||
+ | { | ||
+ | color c = get(mouseX, mouseY); | ||
+ | String colors = int(red(c))+","+int(green(c))+","+int(blue(c))+"\n"; | ||
+ | print(colors); | ||
+ | port.write(colors); | ||
+ | } | ||
+ | </code> | ||
===== Serial Peripheral Interface. Сдвиговый регистр 74НС595 ===== | ===== Serial Peripheral Interface. Сдвиговый регистр 74НС595 ===== | ||
Строка 75: | Строка 142: | ||
==== LCD дисплей (документация) ==== | ==== LCD дисплей (документация) ==== | ||
- | http://files.amperka.ru/datasheets/MT-16S2H.pdf | + | * http://files.amperka.ru/datasheets/MT-16S2H.pdf |
+ | * [[http://wiki.amperka.ru/%D0%BA%D0%BE%D0%BD%D1%81%D0%BF%D0%B5%D0%BA%D1%82-arduino:%D1%82%D0%B5%D1%81%D1%82%D0%B5%D1%80-%D0%B1%D0%B0%D1%82%D0%B0%D1%80%D0%B5%D0%B5%D0%BA?s[]=lcd | Эксперимент 18. Тестер батареек]] | ||
+ | * [[http://wiki.amperka.ru/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE%D1%83%D1%80%D0%BE%D0%BA%D0%B8:13-%D0%B6%D0%BA-%D0%B4%D0%B8%D1%81%D0%BF%D0%BB%D0%B5%D0%B8-lcd | Видеоуроки по Arduino, 13-я серия — ЖК-дисплеи (LCD)]] | ||
+ | * http://arduino.ru/forum/programmirovanie/russkie-bukvy-na-lcd-displee | ||
+ | * https://github.com/mk90/LiquidCrystalRus | ||
==== Автоматический контроль влажности почвы ==== | ==== Автоматический контроль влажности почвы ==== | ||
Строка 98: | Строка 170: | ||
* [[http://www.instructables.com/id/Course-on-MIT-App-Inventor-and-Arduino/]] | * [[http://www.instructables.com/id/Course-on-MIT-App-Inventor-and-Arduino/]] | ||
* [[https://www.youtube.com/watch?v=Y62cQ_Eurn8]] | * [[https://www.youtube.com/watch?v=Y62cQ_Eurn8]] | ||
+ | |||
+ | **Arduino to Arduino by Bluetooth** | ||
+ | |||
+ | * [[http://www.martyncurrey.com/arduino-to-arduino-by-bluetooth/]] | ||
+ | * [[https://www.pjrc.com/teensy/td_libs_AltSoftSerial.html]] | ||
+ | * [[http://www.martyncurrey.com/connecting-2-arduinos-by-bluetooth-using-a-hc-05-and-a-hc-06-pair-bind-and-link/]] | ||
+ | * [[http://robotclass.ru/articles/bluetooth-hc-05-06/]] | ||
+ | |||
+ | ==== Игры на arduino ==== | ||
+ | |||
+ | * [[http://arduino.ru/forum/programmirovanie/igra-na-arduino]] - Идея игры в палочки | ||
+ | * [[http://arduino-ua.com/art42-mini-igra-na-arduino]] - Мини игра на Arduino (Arduino LCD Game) | ||
+ | * [[http://www.instructables.com/id/Arduino-LCD-Game/]] - Мини игра на Arduino (Arduino LCD Game En) | ||
+ | * [[http://howtomechatronics.com/projects/arduino-game-project-replica-of-flappy-bird-for-arduino-on-a-tft-touch-screen/]] | ||
+ | |||
+ | ==== Объединение arduino в сеть ==== | ||
+ | |||
+ | === Соединяем две arduino по шине I2C === | ||
+ | * [[https://lesson.iarduino.ru/page/urok-34-igra-zmeyka-piton-na-matrice-iz-svedodiodov/]] | ||
+ | * [[https://www.youtube.com/watch?v=RgCDTyr27oo]] | ||
+ | * [[http://lesson.iarduino.ru/page/urok-26-3-soedinyaem-dve-arduino-po-shine-i2c/]] | ||
==== Автоматные модели ==== | ==== Автоматные модели ==== | ||
Строка 115: | Строка 208: | ||
** Учебное видео (английский язык) ** \\ | ** Учебное видео (английский язык) ** \\ | ||
- | [[https://www.youtube.com/watch?v=7FWkGmJttD8]] (Внимание на 7 минуте показано как поступать пра наличии конфликта строк) | + | * [[https://www.youtube.com/watch?v=7FWkGmJttD8]] (Внимание, на 7 минуте показано как поступать пра наличии конфликта строк) |
+ | * [[http://nifty.stanford.edu/2010/dodds-picobot/]] - презентация и другие материалы | ||
**Задание:** \\ | **Задание:** \\ | ||
Строка 124: | Строка 218: | ||
==== ПРЕРЫВАНИЯ ==== | ==== ПРЕРЫВАНИЯ ==== | ||
+ | [[http://robotosha.ru/arduino/multi-tasking-arduino.html]] - **Конечные автоматы** | ||
+ | |||
+ | [[http://robotosha.ru/arduino/multitasking-and-interrupts-arduino.html]] - Прерывания на Arduino (Interrupt Service Routine) | ||
+ | |||
+ | Пример реализации **attachInterrupt**: | ||
<code> | <code> | ||
Строка 212: | Строка 311: | ||
http://easyelectronics.ru/ispolzovanie-oscillografa.html | http://easyelectronics.ru/ispolzovanie-oscillografa.html | ||
- | ===== ИГРЫ ===== | + | ====== ИГРЫ ====== |
* [[https://create.arduino.cc/projecthub/projects/tags/games]] - 18 games projects \\ | * [[https://create.arduino.cc/projecthub/projects/tags/games]] - 18 games projects \\ | ||
- | * [[https://create.arduino.cc/projecthub/sistemasymicros/bulls-and-cows-game-with-arduino-2139f0?ref=tag&ref_id=games&offset=8]] - Bulls and Cows Game with Arduino \\ | + | |
- | * [[https://create.arduino.cc/projecthub/cmbrooks/serial-pong-72670c?ref=tag&ref_id=games&offset=13]] - Playing a simple Pong game with two potentiometers connected to an Arduino. A Python script on a PC is reading data and displaying the game. \\ | + | ===== Bulls and Cows Game with Arduino ===== |
- | * [[http://www.instructables.com/id/Arduino-Simple-Memory-Game/]] - Arduino Simple Memory Game \\ | + | |
- | * [[https://www.arduboy.com/]] - Arduboy, the game system the size of a credit card. \\ | + | * [[https://create.arduino.cc/projecthub/sistemasymicros/bulls-and-cows-game-with-arduino-2139f0?ref=tag&ref_id=games&offset=8]] |
- | * [[http://jason-webb.info/2011/03/arduino-processing-workshop-helicopter-game/]] - Arduino + Processing Workshop – Helicopter Game | + | |
+ | ===== Playing a simple Pong game with two potentiometers connected to an Arduino. ===== | ||
+ | |||
+ | * [[https://create.arduino.cc/projecthub/cmbrooks/serial-pong-72670c?ref=tag&ref_id=games&offset=13]] A Python script on a PC is reading data and displaying the game. \\ | ||
+ | * http://help.ubuntu.ru/fullcircle/39/python_%D1%87_13 - Curses в Python | ||
+ | * https://pastebin.com/EluZ3T4P - Curses в Python пример | ||
+ | * http://laa88.blogspot.ru/2012/07/python-curses.html - Curses в Python | ||
+ | |||
+ | ===== Arduino Simple Memory Game ===== | ||
+ | |||
+ | * [[http://www.instructables.com/id/Arduino-Simple-Memory-Game/]] \\ | ||
+ | |||
+ | ===== Arduino + Processing Workshop – Helicopter Game ===== | ||
+ | |||
+ | * [[http://jason-webb.info/2011/03/arduino-processing-workshop-helicopter-game/]] | ||
- | ===== Учебные проекты ===== | + | ====== Учебные проекты ====== |
==== Широтно-импульсная модуляция ==== | ==== Широтно-импульсная модуляция ==== |