{"id":75,"date":"2016-09-25T08:18:01","date_gmt":"2016-09-25T10:18:01","guid":{"rendered":"http:\/\/vejas.defas.lt\/?p=75"},"modified":"2016-09-25T10:38:09","modified_gmt":"2016-09-25T12:38:09","slug":"arduino-sujungimas-su-raspbery","status":"publish","type":"post","link":"http:\/\/vejas.defas.lt\/?p=75","title":{"rendered":"Arduino sujungimas su Raspbery"},"content":{"rendered":"<p>Po kurio laiko pasijungus Raspberry nekorekti\u0161kai u\u017esikrauna sistema &#8211; pajungus per HDMI kabel\u012f prie monitoriaus matosi komandin\u0117s eilut\u0117s tekstas su b\u0117gan\u010diu tekstu, kuriame galima \u012fskaityti informacij\u0105, kad nekurie failai prarasti. pavyksta prisijungti &#8216;putty&#8217; pagalba adresu 192.168.2.177 (root logino nepriima, tenka logintis pi::raspberry). Kaip patikrinti SD kortel\u0119, kurioje yra sistema? Pagalba gugl\u0117je (ty<\/p>\n<p><a href=\"http:\/\/raspberrypi.stackexchange.com\/users\/2972\/frepa\"><u><span style=\"color: #0000ff;\">Frepa<\/span><\/u><\/a><\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/p>\n<div class=\"post-text\">\n<p>\/dev\/mmcblk0p2 is the root file system, so it is not easily unmounted. It could probably be re-mounted as read-only, but a simpler way is to schedule a fsck at the next reboot.<\/p>\n<blockquote><p>sudo touch \/forcefsck<\/p><\/blockquote>\n<p>then reboot. Or reboot with<\/p>\n<blockquote><p>shutdown -rF now<\/p><\/blockquote>\n<p>which does the same. (from <a href=\"http:\/\/superuser.com\/questions\/401217\/how-to-check-root-partition-with-fsck\"><u><span style=\"color: #0000ff;\">http:\/\/superuser.com\/questions\/401217\/how-to-check-root-partition-with-fsck<\/span><\/u><\/a>)<\/p>\n<p>Another option of course is to do the fsck on another linux computer with a card reader.<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>Kita b\u0117da &#8211; nekokia HDMI sujungimo ekrano rezoliucija. Nor\u0117t\u0173si nustatyti pageidaujam\u0105. \u010cia reikia koreguoti \/boot\/config.txt fail\u0105 sekan\u010diai:<\/p>\n<p>atkomentuojame \u0161io failo sekan\u010dias eilutes ir \u012fra\u0161ome norimas skiriamosios gebos reik\u0161mes, pvz. 1280 x 1024, kas atitinka 17&#8243; ir 19&#8243; &#8216;native resolution&#8217;.<\/p>\n<p>framebuffer_width=1280<\/p>\n<p>framebuffer_height=1024<\/p>\n<p>Dabar at\u0117jo eil\u0117 prakalbinti Arduin\u0105 pajungt\u0105 prie Raspberry per USB jungt\u012f. U\u017eklausus Raspberry per komandin\u0119 eilut\u0119 &#8216;lsusb&#8217;, gauname atsakym\u0105:<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>Bus 001 Device 007: ID 1c4f:0002 SiGma Micro Keyboard TRACER Gamma Ivory<br \/>\nBus 001 Device 006: ID 046d:c06c Logitech, Inc. Optical Mouse<br \/>\nBus 001 Device 005: ID 0409:005a NEC Corp. HighSpeed Hub<br \/>\nBus 001 Device 004: ID 2341:8036 Arduino SA Leonardo (CDC ACM, HID)<br \/>\nBus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512\/9514 Fast Ethernet Adapter<br \/>\nBus 001 Device 002: ID 0424:9512 Standard Microsystems Corp. LAN9500 Ethernet 10\/100 Adapter \/ SMSC9512\/9514 Hub<br \/>\nBus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\n\u010dia Arduino SA Leonardo yra m\u016bs\u0173 \u012frenginys.<\/p>\n<p><u><span style=\"color: #0000ff;\">Pasinaudosime pavyzd\u017eiu i\u0161 gugl\u0117s:<\/span><\/u><\/p>\n<p>&#8212;&#8212;-<\/p>\n<p>Run Python 2 on Raspberry Pi. You will find this from the menu under Programming, you should use Python 2 not 3.<\/p>\n<p>Type the following after &gt;&gt;&gt;<\/p>\n<pre>import serial\r\nser = serial.Serial('\/dev\/ttyACM0', 9600)<\/pre>\n<p>The first argument \u2013 \/dev\/ttyACM0 is the name for the USB interface used. To find out the port name, we need to run this command in terminal without Arduino plugged in:<\/p>\n<pre>ls \/dev\/tty*<\/pre>\n<p>Now plug in your Arduio and run the command again. If a new name appears, then this is the name of your port.<\/p>\n<p>The second argument \u2013 9600 is the baud rate and should match with what you set in the Arduino program.<\/p>\n<p>Now lets start a loop listening for messages from the Arduino.<\/p>\n<pre>while 1 :\r\n    ser.readline()<\/pre>\n<p>You will need two hit enter twice after you type the second line. Messages \u2018Hi\u2019 should now start to appear every 2 seconds. You can press Ctrl + C to stop (interrupt) the Python program.<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p>Mano atveju Arduino i\u0161veda \u012f nuosekl\u0173 port\u0105 Analoginio porto reik\u0161m\u0119 (0-1023). Arduino programa paprasta:<\/p>\n<p>void setup() {<br \/>\n\u00a0 \/\/ initialize digital pin 13 as an output.<br \/>\n\u00a0 pinMode(13, OUTPUT);<br \/>\n\u00a0 Serial.begin(9600);<br \/>\n\u00a0 Serial.println(&#8222;Programos startas &#8222;);<br \/>\n}<\/p>\n<p>void loop() {<br \/>\n\u00a0 int x;<br \/>\n\u00a0 digitalWrite(13, HIGH);\u00a0\u00a0 \/\/ turn the LED on (HIGH is the voltage level)<br \/>\n\u00a0\u00a0digitalWrite(13, LOW);\u00a0\u00a0\u00a0 \/\/ turn the LED off by making the voltage LOW<br \/>\n\u00a0 x=analogRead(A5);<br \/>\n\u00a0 Serial.println(x);<br \/>\n}<br \/>\nSekantis \u017eingsnis i\u0161 Raspbery perduoti informacij\u0105 \u012f Arduino. Tame pa\u010diame ineto puslapyje: https:\/\/oscarliang.com\/connect-raspberry-pi-and-arduino-usb-cable\/<\/p>\n<\/div>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Po kurio laiko pasijungus Raspberry nekorekti\u0161kai u\u017esikrauna sistema &#8211; pajungus per HDMI kabel\u012f prie monitoriaus matosi komandin\u0117s eilut\u0117s tekstas su b\u0117gan\u010diu tekstu, kuriame galima \u012fskaityti informacij\u0105, kad nekurie failai prarasti. pavyksta prisijungti &#8216;putty&#8217; pagalba adresu 192.168.2.177 (root logino nepriima, tenka logintis pi::raspberry). Kaip patikrinti SD kortel\u0119, kurioje yra sistema? Pagalba gugl\u0117je (ty Frepa &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; \/dev\/mmcblk0p2 &hellip; <a href=\"http:\/\/vejas.defas.lt\/?p=75\" class=\"more-link\">Skaityti toliau: <span class=\"screen-reader-text\">Arduino sujungimas su Raspbery<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-75","post","type-post","status-publish","format-standard","hentry","category-be-kategorijos"],"acf":[],"_links":{"self":[{"href":"http:\/\/vejas.defas.lt\/index.php?rest_route=\/wp\/v2\/posts\/75","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/vejas.defas.lt\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/vejas.defas.lt\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/vejas.defas.lt\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/vejas.defas.lt\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=75"}],"version-history":[{"count":4,"href":"http:\/\/vejas.defas.lt\/index.php?rest_route=\/wp\/v2\/posts\/75\/revisions"}],"predecessor-version":[{"id":79,"href":"http:\/\/vejas.defas.lt\/index.php?rest_route=\/wp\/v2\/posts\/75\/revisions\/79"}],"wp:attachment":[{"href":"http:\/\/vejas.defas.lt\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=75"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/vejas.defas.lt\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=75"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/vejas.defas.lt\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=75"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}