#MAKERSPACE AFICIONADO & ADVOCATE
  • Home
  • MakerEd is
  • the journey
  • Services
  • Presentations
    • Maker Centered Learning
    • MakerSpaces not just a room
    • Low Cost Low Tech Maker Materials
    • MakerMarketSchool
    • microbit
    • ScreenCasting >
      • what is it
      • examples
      • why do this
      • how to make them available
      • recording tools
      • microphones
      • web hosting
      • iPad options
      • tips
      • resources
    • Student Voices For Assessment >
      • Why
      • StudentVoicesExamples
      • Tools to Create
      • TurningInTheWork
      • TechnicalIssues
      • OtherIdeas
      • YourTurn
    • Tweet Yourself Right
    • Educational Vision of Calvin & Hobbes
    • Wearables
  • me
    • Resume
    • playtime
  • Maker Resources
  • Maker Van
  • Coding&Robotics
    • MakeCode
    • microbit
    • Makerbit
    • bitbooster
    • CRICKIT
    • kittenbot
    • CircuitPlaygroundExpress
    • Edison
    • FiriaLabs
    • VEX
  • CardboardConnectors
  • resonance
    • books
    • videos
    • education & science issues

microbit&OLED

3/2/2020

0 Comments

 
I bought a 0.96”, 128x64,  OLED for $7 (price range ~$4-10 based on quantity). It is tiny, the display being about 2.5 cm x 1.25 cm. It is an I2C device that needs 3.3-5V. You connect it to the micro:bit via pins 19 (SCL) & 20 (SDA). Some of the extension boards have grove port connectors (white 4 pin jacks) already set up for this to make it easier to connect (1 cable with 4 wires).
​
There are a couple of options for makecode extensions with different number of blocks. The third seems to be an older version of the first (both by Tinkeracademy). The second, by
Author: shaoziyang,  gives you more control over what and where {though it does not have a block for drawing diagonal lines}.
Picture
The first block that has to be used is an “initialize” or “init” block. The default address for the device is 60. I tend to put that in “on start” , but it just has to come before using the other blocks in a “forever” block if you prefer.

The next thing that is good to know is that there is a zoom mode which enlarges things to make it easier to read, but also shifts it to 64x32 pixel resolution (zoom=true in the code ; tinkeracademy block set default to this). This means that with zoom=true you have 4 lines of text vs 8, and 12 vs 24 columns of text. You need to know this because you can choose where to start the text. Likewise, if drawing lines or pixels, you have 64 vs 128 for x position and 32 vs 64 for y position in zoom=true mode.
Third  thing is color. Some of the blocks have a color part and your choices are 0 or 1. Color 1 is “normal”, black screen and yellow or blue (for my device, the first line is yellow text, other 3 are blue in zoom=true mode). Color 0 is inverted, text is black and highlighted in the line color.

The obvious use for this is to display sensor or variable data. This can be done easily with the makecode blocks  (code).
Picture
. 
Here is my setup. The oled is connected to a BitBooster from lectrify in order to access pins 19 & 20.

I believe graphing  can be done, but you would have to utilize micropython. The same is true for displaying icons/bitmaps. More exploration is needed for this.

(possible micropython instructions
https://www.littlebird.com.au/a/how-to/81/0-96-oled-screen-with-micro-bit

and
http://www.suppertime.co.uk/blogmywiki/2019/11/microbit-oled-display/

update
You can plot pixels using the blocks in makecode, so you can graph.
The hard part is scaling the y values you get to the screen.
​Create a variable for the x coordinate of the pixel and set it to 0.
If we have zoom=true, then we have 64 possible x values, so the repeat loop can repeat 64 times (collect 64 data points)(maybe it can only repeat 63 times???).
That also means that we have 32 possible values for y. So you have to scale your input to fit between 0 & 31. With a twist. 0 is up top, 31 is at the bottom.
I am doing temperature in Celsius, so I did a simple "31 - rounding of temperature".
I rounded because I am not sure if the sensor rounds or does integers and pixels have integer coordinates. If the temp is 22 C, it will color in a pixel at y=9 (towards the top); if the temp is 0 it will color at y=31 (the bottom). My code cannot register temps below 0.
Then I change X by one to collect the next data point. I did that every half second.
The "clear" command is to erase the last line graphed when i want to graph again.

Remember, if you use "zoom=false", you will have 128 x values and 64 y values for coordinates. So repeat goes to 127 (or 128???) and data values need to scale from 0-64, upside down.

Picture
0 Comments

Your comment will be posted after it is approved.


Leave a Reply.

    Archives

    December 2022
    November 2022
    September 2022
    August 2022
    July 2022
    May 2022
    April 2022
    March 2022
    February 2022
    January 2022
    December 2021
    July 2021
    June 2021
    April 2021
    March 2021
    February 2021
    November 2020
    October 2020
    March 2020
    February 2020
    January 2020
    December 2019
    November 2019
    October 2019
    September 2019
    August 2019
    July 2019
    June 2019
    May 2019
    April 2019
    March 2019
    February 2019
    January 2019
    December 2018
    November 2018
    October 2018
    August 2018
    July 2018
    June 2018
    May 2018
    March 2018
    February 2018
    December 2017
    September 2017
    August 2017
    July 2017
    May 2017
    March 2017
    August 2015
    July 2015
    June 2015
    August 2012
    July 2012

    Categories

    All

    RSS Feed

      Want to talk more?

    Submit
Proudly powered by Weebly
  • Home
  • MakerEd is
  • the journey
  • Services
  • Presentations
    • Maker Centered Learning
    • MakerSpaces not just a room
    • Low Cost Low Tech Maker Materials
    • MakerMarketSchool
    • microbit
    • ScreenCasting >
      • what is it
      • examples
      • why do this
      • how to make them available
      • recording tools
      • microphones
      • web hosting
      • iPad options
      • tips
      • resources
    • Student Voices For Assessment >
      • Why
      • StudentVoicesExamples
      • Tools to Create
      • TurningInTheWork
      • TechnicalIssues
      • OtherIdeas
      • YourTurn
    • Tweet Yourself Right
    • Educational Vision of Calvin & Hobbes
    • Wearables
  • me
    • Resume
    • playtime
  • Maker Resources
  • Maker Van
  • Coding&Robotics
    • MakeCode
    • microbit
    • Makerbit
    • bitbooster
    • CRICKIT
    • kittenbot
    • CircuitPlaygroundExpress
    • Edison
    • FiriaLabs
    • VEX
  • CardboardConnectors
  • resonance
    • books
    • videos
    • education & science issues