{"id":8315,"date":"2017-06-08T16:11:01","date_gmt":"2017-06-08T14:11:01","guid":{"rendered":"http:\/\/blog.wenzlaff.de\/?p=8315"},"modified":"2018-09-07T16:27:36","modified_gmt":"2018-09-07T14:27:36","slug":"eclipse-ide-fuer-die-arduino-c-entwicklung","status":"publish","type":"post","link":"http:\/\/blog.wenzlaff.de\/?p=8315","title":{"rendered":"Eclipse IDE f\u00fcr die Arduino C++ Entwicklung"},"content":{"rendered":"<p>Vor ein paar Tagen hatte ich <a href=\"http:\/\/blog.wenzlaff.de\/?p=8277\" target=\"_blank\">hier<\/a> beschrieben, wie ein Arduino mit der Arduino IDE geflasht wird. Als Java-Entwickler will man am Besten alles in Eclipse machen. Also auch die Arduino-Programmierung. Das geht auch mit dem Eclipse C++ IDE for Arduino 2.0. F\u00fcr den Anfang ist wohl die <a href=\"http:\/\/blog.wenzlaff.de\/?p=8293\" target=\"_blank\">Arduino IDE<\/a> etwas einfacher zu bedienen. Aber mit dieser Anleitung geht es auch in ca. 1 Stunden. Also los &#8230;<\/p>\n<p>\u00dcber den Eclipse Marketplace installieren:<\/p>\n<p><a href=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/06\/Bildschirmfoto-2017-06-08-um-14.43.08.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/06\/Bildschirmfoto-2017-06-08-um-14.43.08.png\" alt=\"\" width=\"674\" height=\"951\" class=\"aligncenter size-full wp-image-8316\" srcset=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/06\/Bildschirmfoto-2017-06-08-um-14.43.08.png 674w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/06\/Bildschirmfoto-2017-06-08-um-14.43.08-213x300.png 213w\" sizes=\"auto, (max-width: 674px) 100vw, 674px\" \/><\/a><\/p>\n<p>Das dauert etwas &#8230;<\/p>\n<p>Dann ein Arduino Projekt anlegen:<!--more--><\/p>\n<p><a href=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/06\/Bildschirmfoto-2017-06-08-um-14.57.46.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/06\/Bildschirmfoto-2017-06-08-um-14.57.46.png\" alt=\"\" width=\"526\" height=\"500\" class=\"aligncenter size-full wp-image-8317\" srcset=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/06\/Bildschirmfoto-2017-06-08-um-14.57.46.png 526w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/06\/Bildschirmfoto-2017-06-08-um-14.57.46-300x285.png 300w\" sizes=\"auto, (max-width: 526px) 100vw, 526px\" \/><\/a><\/p>\n<p>Es gib nur ein Template:<\/p>\n<p><a href=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/06\/Bildschirmfoto-2017-06-08-um-14.58.00.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/06\/Bildschirmfoto-2017-06-08-um-14.58.00.png\" alt=\"\" width=\"524\" height=\"498\" class=\"aligncenter size-full wp-image-8318\" srcset=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/06\/Bildschirmfoto-2017-06-08-um-14.58.00.png 524w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/06\/Bildschirmfoto-2017-06-08-um-14.58.00-300x285.png 300w\" sizes=\"auto, (max-width: 524px) 100vw, 524px\" \/><\/a><\/p>\n<p>Das CPP Ger\u00fcst wird dann schon mal erzeugt:<\/p>\n<p><a href=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/06\/Bildschirmfoto-2017-06-08-um-14.58.41.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/06\/Bildschirmfoto-2017-06-08-um-14.58.41.png\" alt=\"\" width=\"238\" height=\"224\" class=\"aligncenter size-full wp-image-8319\" \/><\/a><\/p>\n<p>Nun brauchen wir einmalig eine Connection vom Typ Arduino<\/p>\n<p><a href=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/06\/Bildschirmfoto-2017-06-08-um-15.04.48.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/06\/Bildschirmfoto-2017-06-08-um-15.04.48.png\" alt=\"\" width=\"523\" height=\"359\" class=\"aligncenter size-full wp-image-8324\" srcset=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/06\/Bildschirmfoto-2017-06-08-um-15.04.48.png 523w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/06\/Bildschirmfoto-2017-06-08-um-15.04.48-300x206.png 300w\" sizes=\"auto, (max-width: 523px) 100vw, 523px\" \/><\/a><\/p>\n<p><a href=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/06\/Bildschirmfoto-2017-06-08-um-15.00.30.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/06\/Bildschirmfoto-2017-06-08-um-15.00.30.png\" alt=\"\" width=\"304\" height=\"416\" class=\"aligncenter size-full wp-image-8320\" srcset=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/06\/Bildschirmfoto-2017-06-08-um-15.00.30.png 304w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/06\/Bildschirmfoto-2017-06-08-um-15.00.30-219x300.png 219w\" sizes=\"auto, (max-width: 304px) 100vw, 304px\" \/><\/a><\/p>\n<p>Mit ein paar Parametern zur Schnittstelle:<\/p>\n<p><a href=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/06\/Bildschirmfoto-2017-06-08-um-15.05.40.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/06\/Bildschirmfoto-2017-06-08-um-15.05.40.png\" alt=\"\" width=\"445\" height=\"358\" class=\"aligncenter size-full wp-image-8325\" srcset=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/06\/Bildschirmfoto-2017-06-08-um-15.05.40.png 445w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/06\/Bildschirmfoto-2017-06-08-um-15.05.40-300x241.png 300w\" sizes=\"auto, (max-width: 445px) 100vw, 445px\" \/><\/a><\/p>\n<p>In meinem Fall das Arduino Nano Board:<\/p>\n<p><a href=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/06\/Bildschirmfoto-2017-06-08-um-15.02.51.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/06\/Bildschirmfoto-2017-06-08-um-15.02.51.png\" alt=\"\" width=\"671\" height=\"522\" class=\"aligncenter size-full wp-image-8322\" srcset=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/06\/Bildschirmfoto-2017-06-08-um-15.02.51.png 671w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/06\/Bildschirmfoto-2017-06-08-um-15.02.51-300x233.png 300w\" sizes=\"auto, (max-width: 671px) 100vw, 671px\" \/><\/a><\/p>\n<p>Und f\u00fcr ein Beispielprojekt eine Lib (ug8lib) f\u00fcr das Display:<\/p>\n<p><a href=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/06\/Bildschirmfoto-2017-06-08-um-15.01.32.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/06\/Bildschirmfoto-2017-06-08-um-15.01.32.png\" alt=\"\" width=\"347\" height=\"415\" class=\"aligncenter size-full wp-image-8321\" srcset=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/06\/Bildschirmfoto-2017-06-08-um-15.01.32.png 347w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/06\/Bildschirmfoto-2017-06-08-um-15.01.32-251x300.png 251w\" sizes=\"auto, (max-width: 347px) 100vw, 347px\" \/><\/a><\/p>\n<p><a href=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/06\/Bildschirmfoto-2017-06-08-um-15.03.30.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/06\/Bildschirmfoto-2017-06-08-um-15.03.30.png\" alt=\"\" width=\"600\" height=\"400\" class=\"aligncenter size-full wp-image-8323\" srcset=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/06\/Bildschirmfoto-2017-06-08-um-15.03.30.png 600w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/06\/Bildschirmfoto-2017-06-08-um-15.03.30-300x200.png 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>Nun kann die Lib auch dem Projekt hinzugef\u00fcgt werden:<\/p>\n<p><a href=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/06\/Bildschirmfoto-2017-06-08-um-15.07.47.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/06\/Bildschirmfoto-2017-06-08-um-15.07.47.png\" alt=\"\" width=\"845\" height=\"532\" class=\"aligncenter size-full wp-image-8326\" srcset=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/06\/Bildschirmfoto-2017-06-08-um-15.07.47.png 845w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/06\/Bildschirmfoto-2017-06-08-um-15.07.47-300x189.png 300w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/06\/Bildschirmfoto-2017-06-08-um-15.07.47-768x484.png 768w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/a><\/p>\n<p>Nun ersetzen wir das Template mit diesem Beispiel Programm:<\/p>\n<pre class=\"lang:c++ decode:true \" >\r\n\r\n#include &lt;Arduino.h&gt;\r\n\r\n#include \"U8glib.h\"\r\n\r\nU8GLIB_SSD1306_128X64 u8g(U8G_I2C_OPT_NONE | U8G_I2C_OPT_DEV_0);\r\n\r\nvoid drawTest(void) {\r\n\tu8g.setFont(u8g_font_unifont);\r\n\tu8g.drawStr(0, 20, \"OK, Start...\");\r\n}\r\n\r\nvoid setup() {\r\n\r\n\tu8g.firstPage();\r\n\tdo {\r\n\t\tdrawTest();\r\n\t} while (u8g.nextPage());\r\n}\r\n\r\nvoid loop() {\r\n\r\n\tdelay(2000);\r\n\r\n\tu8g.firstPage();\r\n\r\n\tdo {\r\n\t\tu8g.setFont(u8g_font_osb18);\r\n\t\tu8g.setFontPosTop();\r\n\t\tu8g.drawStr(10, 10, \"Dont give\");\r\n\t\tu8g.drawStr(10, 30, \"up! Eclipse\");\r\n\r\n\t} while (u8g.nextPage());\r\n}<\/pre>\n<p><strong>TIP!<\/strong> Dabei beachten, das im Gegensatz zur Arduino IDE noch ein <\/p>\n<pre class=\"lang:c++ decode:true \" >#include &lt;Arduino.h&gt;<\/pre>\n<p>hinzugef\u00fcgt werden muss. Sonst gibt es Compile-Fehler, das Methoden nicht gefunden werden.<\/p>\n<p>Jetzt oben auf den Hammer in der Toolbarleiste f\u00fcr den Build und dann ein klick auf den gr\u00fcnen Run Button, und schon wird das Programm auf den Nano hochgeladen.<\/p>\n<pre class=\"lang:default decode:true \" >\r\n\r\navrdude: Version 6.3, compiled on Jan 17 2017 at 12:01:35\r\n         Copyright (c) 2000-2005 Brian Dean, http:\/\/www.bdmicro.com\/\r\n         Copyright (c) 2007-2014 Joerg Wunsch\r\n\r\n         System wide configuration file is \"\/Users\/userdir\/.arduinocdt\/packages\/arduino\/tools\/avrdude\/6.3.0-arduino9\/etc\/avrdude.conf\"\r\n         User configuration file is \"\/Users\/userdir\/.avrduderc\"\r\n         User configuration file does not exist or is not a regular file, skipping\r\n\r\n         Using Port                    : \/dev\/cu.usbserial-A9SV31TT\r\n         Using Programmer              : arduino\r\n         Overriding Baud Rate          : 57600\r\n         AVR Part                      : ATmega328P\r\n         Chip Erase delay              : 9000 us\r\n         PAGEL                         : PD7\r\n         BS2                           : PC2\r\n         RESET disposition             : dedicated\r\n         RETRY pulse                   : SCK\r\n         serial program mode           : yes\r\n         parallel program mode         : yes\r\n         Timeout                       : 200\r\n         StabDelay                     : 100\r\n         CmdexeDelay                   : 25\r\n         SyncLoops                     : 32\r\n         ByteDelay                     : 0\r\n         PollIndex                     : 3\r\n         PollValue                     : 0x53\r\n         Memory Detail                 :\r\n\r\n                                  Block Poll               Page                       Polled\r\n           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack\r\n           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------\r\n           eeprom        65    20     4    0 no       1024    4      0  3600  3600 0xff 0xff\r\n           flash         65     6   128    0 yes     32768  128    256  4500  4500 0xff 0xff\r\n           lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00\r\n           hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00\r\n           efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00\r\n           lock           0     0     0    0 no          1    0      0  4500  4500 0x00 0x00\r\n           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00\r\n           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00\r\n\r\n         Programmer Type : Arduino\r\n         Description     : Arduino\r\n         Hardware Version: 2\r\n         Firmware Version: 1.16\r\n         Vtarget         : 0.0 V\r\n         Varef           : 0.0 V\r\n         Oscillator      : Off\r\n         SCK period      : 0.1 us\r\n\r\navrdude: AVR device initialized and ready to accept instructions\r\n\r\nReading | ################################################## | 100% 0.00s\r\n\r\navrdude: Device signature = 0x1e950f (probably m328p)\r\navrdude: reading input file \".\/Anzeige.hex\"\r\navrdude: writing flash (17700 bytes):\r\n\r\nWriting | ################################################## | 100% 8.89s\r\n\r\navrdude: 17700 bytes of flash written\r\navrdude: verifying flash memory against .\/Anzeige.hex:\r\navrdude: load data flash data from input file .\/Anzeige.hex:\r\navrdude: input file .\/Anzeige.hex contains 17700 bytes\r\navrdude: reading on-chip flash data:\r\n\r\nReading | ################################################## | 100% 7.52s\r\n\r\navrdude: verifying ...\r\navrdude: 17700 bytes of flash verified\r\n\r\navrdude done.  Thank you.\r\n\r\n<\/pre>\n<p>Hier noch ein Foto der IDE:<\/p>\n<p><a href=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/06\/Bildschirmfoto-2017-06-08-um-15.36.38.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/06\/Bildschirmfoto-2017-06-08-um-15.36.38.png\" alt=\"\" width=\"1839\" height=\"1092\" class=\"aligncenter size-full wp-image-8327\" srcset=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/06\/Bildschirmfoto-2017-06-08-um-15.36.38.png 1839w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/06\/Bildschirmfoto-2017-06-08-um-15.36.38-300x178.png 300w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/06\/Bildschirmfoto-2017-06-08-um-15.36.38-768x456.png 768w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/06\/Bildschirmfoto-2017-06-08-um-15.36.38-1024x608.png 1024w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/a><\/p>\n<p>Und hier das Ergebnis &#8222;Dont give up! Eclipse&#8220;:<\/p>\n<p><a href=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/06\/Eclipse--e1496930383657.jpeg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/06\/Eclipse--e1496930383657.jpeg\" alt=\"\" width=\"3264\" height=\"2448\" class=\"aligncenter size-full wp-image-8335\" srcset=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/06\/Eclipse--e1496930383657.jpeg 3264w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/06\/Eclipse--e1496930383657-300x225.jpeg 300w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/06\/Eclipse--e1496930383657-768x576.jpeg 768w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2017\/06\/Eclipse--e1496930383657-1024x768.jpeg 1024w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Vor ein paar Tagen hatte ich hier beschrieben, wie ein Arduino mit der Arduino IDE geflasht wird. Als Java-Entwickler will man am Besten alles in Eclipse machen. Also auch die Arduino-Programmierung. Das geht auch mit dem Eclipse C++ IDE for Arduino 2.0. F\u00fcr den Anfang ist wohl die Arduino IDE etwas einfacher zu bedienen. Aber &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/blog.wenzlaff.de\/?p=8315\" class=\"more-link\"><span class=\"screen-reader-text\">\u201eEclipse IDE f\u00fcr die Arduino C++ Entwicklung\u201c <\/span>weiterlesen<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[220,562,4,1975,79],"tags":[2188,2871,2872,2873,2858,2177,2026],"class_list":["post-8315","post","type-post","status-publish","format-standard","hentry","category-anleitung","category-arduino","category-eclipse","category-plugin","category-programmierung","tag-arduino","tag-arduino-eclipse-ide","tag-cpp","tag-dont-give-up-eclipsenano","tag-dont-give-up","tag-eclipse","tag-ide"],"_links":{"self":[{"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=\/wp\/v2\/posts\/8315","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=8315"}],"version-history":[{"count":0,"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=\/wp\/v2\/posts\/8315\/revisions"}],"wp:attachment":[{"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=8315"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=8315"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=8315"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}