{"id":8053,"date":"2023-03-26T21:18:57","date_gmt":"2023-03-26T21:18:57","guid":{"rendered":"https:\/\/www.fambach.net\/?p=8053"},"modified":"2023-03-26T21:18:59","modified_gmt":"2023-03-26T21:18:59","slug":"codeshorty-serieller-interrupt","status":"publish","type":"post","link":"https:\/\/www.fambach.net\/en\/codeshorty-serieller-interrupt\/","title":{"rendered":"CodeShorty: Serial Interrupt"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_85 ez-toc-wrap-left counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Contents\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewbox=\"0 0 24 24\" version=\"1.2\" baseprofile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.fambach.net\/en\/uno-wire-scannen\/#Zweck\" >Purpose<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.fambach.net\/en\/uno-wire-scannen\/#Schaltung\" >Circuit<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.fambach.net\/en\/uno-wire-scannen\/#Bibliotheken\" >Libraries<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.fambach.net\/en\/uno-wire-scannen\/#Programm\" >Programme<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.fambach.net\/en\/uno-wire-scannen\/#Quellocode\" >Source code<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.fambach.net\/en\/uno-wire-scannen\/#Ausgabe\" >Output<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.fambach.net\/en\/uno-wire-scannen\/#Probleme\" >Problems<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.fambach.net\/en\/uno-wire-scannen\/#Das_Wire_Modul_antwortet_nicht\" >The Wire module is not responding<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.fambach.net\/en\/uno-wire-scannen\/#Fazit\" >Conclusion<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/www.fambach.net\/en\/uno-wire-scannen\/#Quellen\" >Sources<\/a><\/li><\/ul><\/nav><\/div>\n\n<p class=\"wp-block-paragraph\">Ist es m&ouml;glich Eingaben auf der Seriellen-Schnittstellen per Interrupt abzufangen?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Die Antwort is wohl eher jain, es ist m&ouml;glich die Serial Event Funktion zu verwenden. Diese wird nach jeder Loop ausgef&uuml;hrt, unterbricht diese aber nicht.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Zweck\"><\/span>Purpose<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>Benutzereingaben &uuml;ber Terminal<\/li><li>Kommunikations mit anderen Ger&auml;ten &uuml;ber die Serielle-Schnittstelle<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">N&ouml;tige Bibliotheken<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">None <\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Programm\"><\/span>Programme<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Es gibt in der Arduino-Gui die M&ouml;glichkeit eine EventFunktion zu verwenden. Diese wird immer nach dem Loop aufgerufen, unterbricht aber keinen laufenden Code.<\/p>\n\n\n\n<script>\nvar project = \"sfambach\/arduino\/tree\/master\/src\/SerialEvent\";\nvar file = \"\/SerialEvent.ino\";\nvar test = \"sfambach\/arduino\/blob\/master\/src\/SerialEvent\/SerialEvent.ino\";\nvar startAt = 4;\nvar endAt = 0;\n\ndocument.write('<a href=\"https:\/\/github.com\/'+project+'\" target=\"_blank\">Link zu Git');\ndocument.write('<a href=\"https:\/\/downgit.github.io\/#\/home?url=https:\/\/github.com\/'+project+'\" target=\"_blank\">Download des Projektes mit DownGit<\/script><p>&#8218;);\n\ndocument.write(&#8218;<\/p><div style=\"font-size:1vw\">&#8218;);\ndocument.write(&#8218;<script src=\"https:\\\/\\\/gist-it-dot-helloid-roadmap.ew.r.appspot.com\\\/https:\\\/\\\/github.com\\\/'+test+'\\?slice='+startAt+':'+endAt+'\"><\\\/script>');\ndocument.write('<\/script><p>&#8218;);\n\n\n\n\n<\/p><p class=\"wp-block-paragraph\">Damit die Event Funktion nicht blockiert habe ich die WHILE Schleife herausgenommen. Die Funktion ist die gleiche wie vorher, allerdings wird bei jedem Zeichen nochmal die Arbeitsschleife durchlaufen. Dies kann evtl. zu anderen unerw&uuml;nschten Effekten f&uuml;hren.<\/p><script>\nvar project = \"sfambach\/arduino\/tree\/master\/src\/SerialEventNonBlocking\";\nvar file = \"\/SerialEventNonBlocking.ino\";\nvar test = project +file;\nvar startAt = 40;\nvar endAt = 0;\n\ndocument.write('<a href=\"https:\/\/github.com\/'+project+'\" target=\"_blank\">Link zu Git');\ndocument.write('<a href=\"https:\/\/downgit.github.io\/#\/home?url=https:\/\/github.com\/'+project+'\" target=\"_blank\">Download des Projektes mit DownGit');\n\ndocument.write('<div style=\"font-size:1vw\">');\ndocument.write('<script src=\"https:\\\/\\\/gist-it-dot-helloid-roadmap.ew.r.appspot.com\\\/https:\\\/\\\/github.com\\\/'+test+'\\?slice='+startAt+':'+endAt+'\"><\\\/script>');\ndocument.write('');\n<\/script><h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Probleme\"><\/span>Problems<span class=\"ez-toc-section-end\"><\/span><\/h2><h3 class=\"wp-block-heading\">Ausgabe erfolgt nicht<\/h3><p class=\"wp-block-paragraph\">Darauf achten, dass das verwendete Terminal auf das Zeilenende \"new line\" eingestellt ist.<\/p><h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Fazit\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2><p class=\"wp-block-paragraph\">Kein Interterrupt aber daf&uuml;r eine Funktionalit&auml;t die man nutzen kann.<\/p><h2 class=\"wp-block-heading\">Andere Shorties<\/h2><ul class=\"display-posts-listing\">\n<li class=\"listing-item\"><a class=\"title\" href=\"https:\/\/www.fambach.net\/en\/codeshorty-serieller-interrupt\/\">CodeShorty: Serial Interrupt<\/a><\/li>\n<li class=\"listing-item\"><a class=\"title\" href=\"https:\/\/www.fambach.net\/en\/uno-wire-scannen\/\">CodeShorty: Wire Scanning (Uno)<\/a><\/li>\n<\/ul>\n\n\n\n<\/p><h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Quellen\"><\/span>Sources<span class=\"ez-toc-section-end\"><\/span><\/h2><p class=\"wp-block-paragraph\"><a href=\"https:\/\/forum.arduino.cc\/t\/how-to-use-serial-interrupt-in-arduino\/335712\/29\">https:\/\/forum.arduino.cc\/t\/how-to-use-serial-interrupt-in-arduino\/335712\/29<\/a><\/p><p class=\"wp-block-paragraph\"><a href=\"https:\/\/www.arduino.cc\/en\/Tutorial\/BuiltInExamples\/SerialEvent\">https:\/\/www.arduino.cc\/en\/Tutorial\/BuiltInExamples\/SerialEvent<\/a><\/p><p class=\"wp-block-paragraph\"><a href=\"https:\/\/forum.arduino.cc\/t\/interrupt-uber-serielle-schnittstelle\/545390\">https:\/\/forum.arduino.cc\/t\/interrupt-uber-serielle-schnittstelle\/545390<\/a><\/p><p class=\"wp-block-paragraph\"><a href=\"https:\/\/forum.arduino.cc\/t\/interrupt-sobald-daten-in-serial-eingangspuffer-stehen\/132916\">https:\/\/forum.arduino.cc\/t\/interrupt-sobald-daten-in-serial-eingangspuffer-stehen\/132916<\/a><\/p><p class=\"wp-block-paragraph\"><\/p><p class=\"wp-block-paragraph\"><\/p>","protected":false},"excerpt":{"rendered":"<p>Ist es m&ouml;glich Eingaben auf der Seriellen-Schnittstellen per Interrupt abzufangen? Die Antwort is wohl eher jain, es ist m&ouml;glich die Serial Event Funktion zu verwenden. Diese wird nach jeder Loop ausgef&uuml;hrt, unterbricht diese aber nicht. Zweck Benutzereingaben &uuml;ber Terminal Kommunikations mit anderen Ger&auml;ten &uuml;ber die Serielle-Schnittstelle N&ouml;tige Bibliotheken Keine Programm Es gibt in der Arduino-Gui &#8230;<\/p>\n<a href=\"https:\/\/www.fambach.net\/en\/uno-wire-scannen\/\" class=\"read-more-link\">Carry on reading <span class=\"screen-reader-text\">\"CodeShorty: Wire Scannen (Uno)\"<\/span> <span class=\"meta-nav\">\u2192<\/span><\/a>","protected":false},"author":1,"featured_media":7120,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_lmt_disableupdate":"no","_lmt_disable":"no","footnotes":""},"categories":[175,184,539],"tags":[54,497,35,540,542,541],"class_list":["post-8053","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-arduino-gui","category-c-c","category-codeshorty","tag-arduino-gui","tag-c-2","tag-c","tag-serial","tag-serielle-schnittstelle","tag-serielles-interface","penguin-post","penguin-post-not-sticky"],"modified_by":"sfambach","_links":{"self":[{"href":"https:\/\/www.fambach.net\/en\/wp-json\/wp\/v2\/posts\/8053","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.fambach.net\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.fambach.net\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.fambach.net\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.fambach.net\/en\/wp-json\/wp\/v2\/comments?post=8053"}],"version-history":[{"count":20,"href":"https:\/\/www.fambach.net\/en\/wp-json\/wp\/v2\/posts\/8053\/revisions"}],"predecessor-version":[{"id":9266,"href":"https:\/\/www.fambach.net\/en\/wp-json\/wp\/v2\/posts\/8053\/revisions\/9266"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.fambach.net\/en\/wp-json\/wp\/v2\/media\/7120"}],"wp:attachment":[{"href":"https:\/\/www.fambach.net\/en\/wp-json\/wp\/v2\/media?parent=8053"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.fambach.net\/en\/wp-json\/wp\/v2\/categories?post=8053"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.fambach.net\/en\/wp-json\/wp\/v2\/tags?post=8053"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}