{"id":16398,"date":"2020-06-29T09:16:30","date_gmt":"2020-06-29T13:16:30","guid":{"rendered":"https:\/\/scruss.com\/blog\/?p=16398"},"modified":"2020-06-29T09:16:33","modified_gmt":"2020-06-29T13:16:33","slug":"micropython-on-the-brainpad-classic-bp2","status":"publish","type":"post","link":"https:\/\/scruss.com\/blog\/2020\/06\/29\/micropython-on-the-brainpad-classic-bp2\/","title":{"rendered":"MicroPython on the BrainPad Classic\/BP2"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2020\/06\/brainpad1-1024x576.jpg\" alt=\"GHI Electronics BrainPad Classic\/BP2 electronics project board on a tasteful faux-leopard background. Small OLED screen is showing &quot;SCRUSS 2020&quot;\" class=\"wp-image-16399\" srcset=\"https:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2020\/06\/brainpad1-1024x576.jpg 1024w, https:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2020\/06\/brainpad1-320x180.jpg 320w, https:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2020\/06\/brainpad1-160x90.jpg 160w, https:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2020\/06\/brainpad1-768x432.jpg 768w, https:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2020\/06\/brainpad1-1200x675.jpg 1200w, https:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2020\/06\/brainpad1.jpg 1280w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption>GHI Electronics BrainPad Classic\/BP2 in <a href=\"https:\/\/www.thingiverse.com\/thing:4152233\">3d printed case<\/a><\/figcaption><\/figure>\n\n\n\n<p>I&#8217;ve extended the MicroPython examples for the BrainPad Classic so that all of the devices work: <a href=\"https:\/\/github.com\/scruss\/brainpad-micropython\">scruss\/brainpad-micropython: Micropython examples for the BrainPad Classic (BP2) from GHI Electronics<\/a>.<\/p>\n\n\n\n<p>The ones that already worked in the <a href=\"https:\/\/github.com\/chalei\/brainpad-micropython\">original examples repo<\/a> are:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>buttons<\/li><li>accelerometer<\/li><li>LEDs<\/li><li>light sensor<\/li><li>OLED screen<\/li><\/ul>\n\n\n\n<p>I&#8217;ve added:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>temperature sensor<\/strong>: although my calibration may be a bit off on the MCP9701a used on the board<\/li><li><strong>timer blink example<\/strong>: STM32 Timers are cool and we should use them<\/li><li><strong>PWM RGB LED example<\/strong>: floating-point silliness with <a href=\"https:\/\/scruss.com\/blog\/2019\/03\/23\/hsvish-colour-wheel-in-python\/\">HSV(ish) Colour Wheel in Python<\/a><\/li><li><strong>buzzer<\/strong>: simple tones plus <a href=\"https:\/\/scruss.com\/blog\/2020\/04\/18\/todays-achievement-make-my-3d-printer-sound-like-a-washing-machine\/\">tunes<\/a> (in <a href=\"https:\/\/en.wikipedia.org\/wiki\/Ring_Tone_Transfer_Language\">RTTTL<\/a>) via <a href=\"https:\/\/github.com\/dhylands\/upy-rtttl\">dhylands \/ upy-rtttl<\/a><\/li><li><strong>servos<\/strong>: I may have forgotten to put the example in there, but the standard <a href=\"https:\/\/docs.micropython.org\/en\/latest\/pyboard\/tutorial\/servo.html\">Servo(1)<\/a> code should work.<\/li><\/ul>\n\n\n\n<p>Yes, it would be nice to have a slick unified library like the <a href=\"https:\/\/microbit-micropython.readthedocs.io\/en\/latest\/\">BBC micro:bit<\/a> does. For later, though.<\/p>\n\n\n\n<p>Other resources:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/scruss.com\/wordpress\/wp-content\/uploads\/2020\/06\/BrainPad-BP2-Schematic.pdf\">BrainPad Classic\/BP2 Schematic<\/a><\/li><li>STM32F401RE <a href=\"https:\/\/www.st.com\/en\/microcontrollers-microprocessors\/stm32f401re.html\">summary<\/a> and <a href=\"https:\/\/www.st.com\/resource\/en\/datasheet\/stm32f401re.pdf\">datasheet<\/a>: because sometimes you need to know what Timer talks to which Pin \u00e2\u20ac\u00a6<\/li><\/ul>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve extended the MicroPython examples for the BrainPad Classic so that all of the devices work: scruss\/brainpad-micropython: Micropython examples for the BrainPad Classic (BP2) from GHI Electronics. The ones that already worked in the original examples repo are: buttons accelerometer LEDs light sensor OLED screen I&#8217;ve added: temperature sensor: although my calibration may be a [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"MicroPython on the BrainPad Classic\/BP2: examples for all of the I\/O devices","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[2],"tags":[],"class_list":["post-16398","post","type-post","status-publish","format-standard","hentry","category-goatee-stroking-musing-or-something"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pQNZZ-4gu","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/posts\/16398","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/comments?post=16398"}],"version-history":[{"count":1,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/posts\/16398\/revisions"}],"predecessor-version":[{"id":16401,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/posts\/16398\/revisions\/16401"}],"wp:attachment":[{"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/media?parent=16398"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/categories?post=16398"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/tags?post=16398"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}