Week 10 - Output Devices

This week we have the following tasks to complete:

  • measure the power consumption of an output device
  • add an output device to a microcontroller board you've designed and program it to do something

Group Assignment

The weekly group assignment can be accessed here.

OLED Display

Beside the NeoPixel that I used in week 08 I experiment with a 0.96" 128x64 px OLED display by first running a simple "Hello World" program, where I go inspired by Sungmoon Lim. I modified his code and come up with the following:

#include <Wire.h>               // include wire library need it for the Adafruit_GFX library
#include <Adafruit_GFX.h>       // include Adafruit_GFX library need it for the Adafruit_SSD1306 library
#include <Adafruit_SSD1306.h>   // include Adafruit_SSD1306 library tp control the OLED display

#define SCREEN_WIDTH 128        // set OLED display width
#define SCREEN_HEIGHT 64        // set OLED display height
#define OLED_RESET -1           // set the reset pin

Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET); // initialize an Adafruit_SSD1306 object called display with the parameters from above

void setup() {
  Serial.begin(115200);                               // initialize serial communication with a baudrate of 115200

  if (!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) {   // checked if a display is available
    Serial.println(F("SSD1306 allocation failed"));   // if no display is available send an error message to the serial monitor
    for(;;);
  }

  display.clearDisplay();                             // clear the display --> set every pixel to black
}

void displayMessage(const char* message) {            // function to visualize a message on the display
  display.clearDisplay();
  display.setTextSize(1);
  display.setTextColor(SSD1306_WHITE);                // set the text color
  display.setCursor(0,0);                             // set the position where the text is shown on the display
  display.println(message);                           // send the input from the function to the display
  display.display();                                  // show data on the display with the parameters from above
}

void loop() {
  displayMessage("Hello World");                      // display "Hello World" on the display
}

oled 01

What I learn this week

What I want to improve next week

  • Improve my time management again, I tried to maxed everything out which did't work so I have to go one step back to finish everything in time.

Design Files


To create this page, I used ChatGPT to check my syntax and grammar.

Copyright 2025 < Benedikt Feit > - Creative Commons Attribution Non Commercial

Source code hosted at gitlab.fabcloud.org