#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

OLEDintro

4/3/2021

0 Comments

 
More playing around with the #microbit & #makecode.
I started looking into using a 0.96" OLED screen for output from a micro:bit (and a 4x4 matrix membrane keypad for inputs)...so here are some beginning thoughts about the OLED...
OLED stands for organic light-emitting diode (OLED or organic LED), sometimes known as organic electroluminescent (organic EL) diode. Most often I see two size/resolutions , 128x64 and 128x32 pixels. I have played with the 128x64. The text can be white, blue, yellow, or some combo of those and they cost from $4-7 based on how many you buy on Amazon.
I prefer to buy ones with the headers already attached (I don't want to solder).

You need an expansion board for the micro:bit because you need access to pins 19 & 20
There are many available, ranging from $7 to $50. They all have different features, as well as different power inputs jacks (jst, micro USB, barrel). Some have pins/sockets to connect to the pins, some have grove connectors... so you will also need the correct wires.

pictured :
kittenbot IOBIT ​                Lectrify BitBooster.             dupont wires              grove wires

Connections... be careful. Always plug GND in first and remove it last (a best practice).
Pin 19 is the SCL (serial clock) connection and Pin 20 is the SDA (serial data) connection.


The Grove I2C connector (white plugs & cables) has a standard layout. 
Pin 1 is the SCL signal (serial clock) and Pin 2 is the SDA signal (serial data). Power is Pin 3 and Ground is Pin 4 (usually in the order white, yellow, red, black)
Some devices don't adhere to this order. That is why it is good to have a grove-header pin converter cord vs a grove-grove cord    
​Look at the OLED... it goes SDA, SCL, PWR, GND.
You need to import the blocks for this device from an extension in makecode { https://makecode.microbit.org/ }
Start a "New project” 
Use either the gear in top right or “Advanced” to get to “Extensions
Search for “oled”
The second one has more options
There are some nuances you have to understand for things to show up correctly.
The origin (0,0) is at the top left

128x64 pixels means x pixels numbered from 0-127 and y pixels numbered 0-63
So pixel (0,0) is in top left corner ; pixel (127,63) is in bottom right corner.
There are 8 lines of text possible with 24 characters each (text, numbers)
BUT...
There is a "zoom" feature, and 128x64 is when "zoom=false".
Because those 8 lines of text are tiny, they added a "zoom = true" block to double the size of text. When "zoom=true" there are 4 lines of 12 characters.
That also means x goes from 0-63 and y from 0-31.

The first thing you have to do with the coding is tell the program you have an OLED and where it is. This is accomplished with the "init OLED with addr 60" block. This has to go before any OLED commands. A good practice is to put this on "on start". It is probably good to "clear" it also. 
Picture
Picture
Now it is just a matter of what you want to display...
Built in sensor data like temperature, light level, accelerometer, sound?
Values for variables?
(almost forgot-they have an option for "color" -- the options are 0 or 1. see which you prefer)

You can make a line graph by plotting pixels.
Basically, you will light up pixels at (x, value) and just iterate the x from 0-127 (or 0-63)
Two things to think about/do
1) since the origin is top left, i feel it is easier to turn the OLED upside down and iterate x from 127-0 (go by -1)(or 63-0)
2) You need to map your sensor values to the screen size (63 or 31 depending on zoom)
You need to know what values your sensor can detect (0-255? 0-1023? 0-10?)
There is a block for that...but you also want to round the values (get integer values)
Here is an example :
Picture
I will make some videos soon...
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