{"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_73 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 Content\"><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\" title=\"Zweck\">Zweck<\/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\" title=\"Schaltung\">Schaltung<\/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\" title=\"Libraries\">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\" title=\"Programm\">Programm<\/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\" title=\"Quellocode\">Quellocode<\/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\" title=\"Ausgabe\">Ausgabe<\/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\" title=\"Problems\">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\" title=\"Das Wire Modul antwortet nicht\">Das Wire Modul antwortet nicht<\/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\" title=\"Conclusion\">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\" title=\"Sources\">Sources<\/a><\/li><\/ul><\/nav><\/div>\n\n<p>Ist es m\u00f6glich Eingaben auf der Seriellen-Schnittstellen per Interrupt abzufangen?<\/p>\n\n\n\n<p>Die Antwort is wohl eher jain, es ist m\u00f6glich die Serial Event Funktion zu verwenden. Diese wird nach jeder Loop ausgef\u00fchrt, unterbricht diese aber nicht.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Zweck\"><\/span>Zweck<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ul><li>Benutzereingaben \u00fcber Terminal<\/li><li>Kommunikations mit anderen Ger\u00e4ten \u00fcber die Serielle-Schnittstelle<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">N\u00f6tige Bibliotheken<\/h2>\n\n\n\n<p>Keine <\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Programm\"><\/span>Programm<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Es gibt in der Arduino-Gui die M\u00f6glichkeit 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<\/a>');\ndocument.write('<div><a href=\"https:\/\/downgit.github.io\/#\/home?url=https:\/\/github.com\/'+project+'\" target=\"_blank\">Download des Projektes mit DownGit<\/a><\/div>');\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('<\/div>');\n<\/script>\n\n\n\n<p>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\u00fcnschten Effekten f\u00fchren.<\/p>\n\n\n\n<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<\/a>');\ndocument.write('<div><a href=\"https:\/\/downgit.github.io\/#\/home?url=https:\/\/github.com\/'+project+'\" target=\"_blank\">Download des Projektes mit DownGit<\/a><\/div>');\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('<\/div>');\n<\/script>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Probleme\"><\/span>Problems<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Ausgabe erfolgt nicht<\/h3>\n\n\n\n<p>Darauf achten, dass das verwendete Terminal auf das Zeilenende \"new line\" eingestellt ist.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Fazit\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Kein Interterrupt aber daf\u00fcr eine Funktionalit\u00e4t die man nutzen kann.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Andere Shorties<\/h2>\n\n\n<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<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Quellen\"><\/span>Sources<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p><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>\n\n\n\n<p><a href=\"https:\/\/www.arduino.cc\/en\/Tutorial\/BuiltInExamples\/SerialEvent\">https:\/\/www.arduino.cc\/en\/Tutorial\/BuiltInExamples\/SerialEvent<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/forum.arduino.cc\/t\/interrupt-uber-serielle-schnittstelle\/545390\">https:\/\/forum.arduino.cc\/t\/interrupt-uber-serielle-schnittstelle\/545390<\/a><\/p>\n\n\n\n<p><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>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>","protected":false},"excerpt":{"rendered":"<p>Ist es m\u00f6glich Eingaben auf der Seriellen-Schnittstellen per Interrupt abzufangen? Die Antwort is wohl eher jain, es ist m\u00f6glich die Serial Event Funktion zu verwenden. Diese wird nach jeder Loop ausgef\u00fchrt, unterbricht diese aber nicht. Zweck Benutzereingaben \u00fcber Terminal Kommunikations mit anderen Ger\u00e4ten \u00fcber die Serielle-Schnittstelle N\u00f6tige 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\">Continue reading <span class=\"screen-reader-text\">\"CodeShorty: Wire Scannen (Uno)\"<\/span> <span class=\"meta-nav\">&rarr;<\/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],"modified_by":"sfambach","_links":{"self":[{"href":"https:\/\/www.fambach.net\/en\/wp-json\/wp\/v2\/posts\/8053"}],"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}]}}