{"id":76,"date":"2024-11-05T11:01:18","date_gmt":"2024-11-05T11:01:18","guid":{"rendered":"https:\/\/myjetsonnano.hopto.org\/?p=76"},"modified":"2024-11-05T11:01:18","modified_gmt":"2024-11-05T11:01:18","slug":"uiflow2-atoms3u-function-example","status":"publish","type":"post","link":"https:\/\/myjetsonnano.perseus314.com\/index.php\/2024\/11\/05\/uiflow2-atoms3u-function-example\/","title":{"rendered":"UiFlow2 AtomS3U function example"},"content":{"rendered":"\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"283\" height=\"178\" src=\"https:\/\/myjetsonnano.perseus314.com\/wp-content\/uploads\/2024\/11\/image-3.png\" alt=\"\" class=\"wp-image-77\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"283\" height=\"117\" src=\"https:\/\/myjetsonnano.perseus314.com\/wp-content\/uploads\/2024\/11\/image-4.png\" alt=\"\" class=\"wp-image-78\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"652\" height=\"181\" src=\"https:\/\/myjetsonnano.perseus314.com\/wp-content\/uploads\/2024\/11\/image-5.png\" alt=\"\" class=\"wp-image-79\" srcset=\"https:\/\/myjetsonnano.perseus314.com\/wp-content\/uploads\/2024\/11\/image-5.png 652w, https:\/\/myjetsonnano.perseus314.com\/wp-content\/uploads\/2024\/11\/image-5-300x83.png 300w\" sizes=\"auto, (max-width: 652px) 100vw, 652px\" \/><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code>import os, sys, io\nimport M5\nfrom M5 import *\n\n\n\n\n\n\nn = None\n\n# Describe this function...\ndef factorial(n):\n  if n == 0:\n    return 1\n  return n * factorial(n - 1)\n\n\ndef setup():\n  global n\n\n  M5.begin()\n  print(factorial(4))\n\n\ndef loop():\n  global n\n  M5.update()\n\n\nif __name__ == '__main__':\n  try:\n    setup()\n    while True:\n      loop()\n  except (Exception, KeyboardInterrupt) as e:\n    try:\n      from utility import print_error_msg\n      print_error_msg(e)\n    except ImportError:\n      print(\"please update to latest firmware\")\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":80,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,10],"tags":[],"class_list":["post-76","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-atoms3u","category-uiflow2"],"_links":{"self":[{"href":"https:\/\/myjetsonnano.perseus314.com\/index.php\/wp-json\/wp\/v2\/posts\/76","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/myjetsonnano.perseus314.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/myjetsonnano.perseus314.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/myjetsonnano.perseus314.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/myjetsonnano.perseus314.com\/index.php\/wp-json\/wp\/v2\/comments?post=76"}],"version-history":[{"count":1,"href":"https:\/\/myjetsonnano.perseus314.com\/index.php\/wp-json\/wp\/v2\/posts\/76\/revisions"}],"predecessor-version":[{"id":81,"href":"https:\/\/myjetsonnano.perseus314.com\/index.php\/wp-json\/wp\/v2\/posts\/76\/revisions\/81"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/myjetsonnano.perseus314.com\/index.php\/wp-json\/wp\/v2\/media\/80"}],"wp:attachment":[{"href":"https:\/\/myjetsonnano.perseus314.com\/index.php\/wp-json\/wp\/v2\/media?parent=76"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/myjetsonnano.perseus314.com\/index.php\/wp-json\/wp\/v2\/categories?post=76"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/myjetsonnano.perseus314.com\/index.php\/wp-json\/wp\/v2\/tags?post=76"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}