{"id":198,"date":"2026-01-05T12:30:47","date_gmt":"2026-01-05T12:30:47","guid":{"rendered":"https:\/\/myjetsonnano.hopto.org\/?p=198"},"modified":"2026-06-27T23:59:42","modified_gmt":"2026-06-27T22:59:42","slug":"atoms3u-lamp-test","status":"publish","type":"post","link":"https:\/\/myjetsonnano.perseus314.com\/index.php\/2026\/01\/05\/atoms3u-lamp-test\/","title":{"rendered":"AtomS3U lamp test"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Here&#8217;s a minimal test program in micropython<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>from hardware import RGB\nimport time\n\n# Initialize LED\nrgb = RGB()\nrgb.set_brightness(70)  # visible intensity\n\n# Define the colors to toggle (RGB tuples)\ncolors = &#91;\n    (255, 0, 0),    # Red\n    (0, 255, 0),    # Green\n    (0, 0, 255),    # Blue\n    (255, 255, 0),  # Yellow\n    (0, 255, 255),  # Cyan\n    (255, 0, 255),  # Magenta\n    (255, 255, 255) # White\n]\n\nwhile True:\n    for color in colors:\n        rgb.fill(color)  # set LED color in buffer\n        rgb.write()      # flush buffer \u2192 LED updates\n        time.sleep(1)    # hold color for 1 second\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">And in C for Arduino IDE<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>#include &lt;Adafruit_NeoPixel.h>\n\n\/\/ On the M5Stack AtomS3U, the built-in WS2812 LED is connected to GPIO 35\n#define LED_PIN    35\n#define NUM_LEDS   1\n\nAdafruit_NeoPixel rgb(NUM_LEDS, LED_PIN, NEO_GRB + NEO_KHZ800);\n\nstruct Color {\n  uint8_t r;\n  uint8_t g;\n  uint8_t b;\n};\n\nColor colors&#91;] = {\n  {255, 0, 0},     \/\/ Red\n  {0, 255, 0},     \/\/ Green\n  {0, 0, 255},     \/\/ Blue\n  {255, 255, 0},   \/\/ Yellow\n  {0, 255, 255},   \/\/ Cyan\n  {255, 0, 255},   \/\/ Magenta\n  {255, 255, 255}  \/\/ White\n};\n\nconst int numColors = sizeof(colors) \/ sizeof(colors&#91;0]);\n\nvoid setup() {\n  rgb.begin();\n  rgb.setBrightness(70);  \/\/ Adjusted for clear, visible intensity\n  rgb.show();             \n}\n\nvoid loop() {\n  for (int i = 0; i &lt; numColors; i++) {\n    rgb.setPixelColor(0, rgb.Color(colors&#91;i].r, colors&#91;i].g, colors&#91;i].b));\n    rgb.show();\n    delay(1000); \/\/ Hold for 1 second\n  }\n}\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here&#8217;s a minimal test program in micropython And in C for Arduino IDE<\/p>\n","protected":false},"author":1,"featured_media":200,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21,8,17,12,10],"tags":[],"class_list":["post-198","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-arduinoide","category-atoms3u","category-c","category-micropython","category-uiflow2"],"_links":{"self":[{"href":"https:\/\/myjetsonnano.perseus314.com\/index.php\/wp-json\/wp\/v2\/posts\/198","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=198"}],"version-history":[{"count":3,"href":"https:\/\/myjetsonnano.perseus314.com\/index.php\/wp-json\/wp\/v2\/posts\/198\/revisions"}],"predecessor-version":[{"id":288,"href":"https:\/\/myjetsonnano.perseus314.com\/index.php\/wp-json\/wp\/v2\/posts\/198\/revisions\/288"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/myjetsonnano.perseus314.com\/index.php\/wp-json\/wp\/v2\/media\/200"}],"wp:attachment":[{"href":"https:\/\/myjetsonnano.perseus314.com\/index.php\/wp-json\/wp\/v2\/media?parent=198"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/myjetsonnano.perseus314.com\/index.php\/wp-json\/wp\/v2\/categories?post=198"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/myjetsonnano.perseus314.com\/index.php\/wp-json\/wp\/v2\/tags?post=198"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}