Bitmap Animation on SSD1331 OLED Display (SPI) With Visuino

by RonFrtek in Circuits > Arduino

2018 Views, 4 Favorites, 0 Comments

Bitmap Animation on SSD1331 OLED Display (SPI) With Visuino

Visuino Tutorial Bitmap Animation on SSD1331 OLED Display (SPI)

In this tutorial we will display and move around a bitmap image in a simple form of animation on the SSD1331 OLED Display (SPI) with Visuino.

Watch the video.

What You Will Need

oled1331.jpg
VisuinoAdvrtisementM5Stack8.jpg
FZEK4WBK3XGYAP0.LARGE.jpg
New-Mini-Universal-Test-Protoboard-400-Tie-Points-PCB-Breadboard-for-Arduino.jpg
  • Arduino UNO (or any other Arduino)
  • SSD1331 OLED Display (SPI)
  • Breadboard
  • Jumper wires
  • Visuino program: Download Visuino

The Circuit

oled1331-.jpg

  • Connect Display pin[CS] to Arduino digital pin[7]
  • Connect Display pin[DC] to Arduino digital pin[8]
  • Connect Display pin[RES] to Arduino digital pin[9]
  • Connect Display pin[SDA] to Arduino digital pin[11]
  • Connect Display pin[SCL] to Arduino digital pin[13]
  • Connect Display pin[VCC] to Arduino positive pin[+5V]
  • Connect Display pin[GND] to Arduino ground pin[GND]

Start Visuino, and Select the Arduino UNO Board Type

F4GNY5CK54FYLVR.LARGE.jpg
F311FBVK5AHN5HJ.LARGE.jpg

To start programming the Arduino, you will need to have the Arduino IDE installed from here: https://www.arduino.cc/.

Please be aware that there are some critical bugs in Arduino IDE 1.6.6. Make sure that you install 1.6.7 or higher, otherwise this Instructable will not work! If you have not done follow the steps in this Instructable to setup the Arduino IDE to program Arduino UNO! The Visuino: https://www.visuino.eu also needs to be installed. Start Visuino as shown in the first picture Click on the "Tools" button on the Arduino component (Picture 1) in Visuino When the dialog appears, select "Arduino UNO" as shown on Picture 2

In Visuino ADD Components

2020-04-27_12-22-35.jpg
2020-04-27_12-22-13.jpg

  • Add "SSD1331 OLED Display (SPI)" component
  • Add 2X "Sine Integer Generator"

In Visuino Set Components

2020-04-27_12-24-31.jpg
2020-04-27_12-24-42.jpg
2020-04-27_12-25-15.jpg
2020-04-27_12-25-51.jpg
2020-04-27_12-26-07.jpg
2020-04-27_12-42-00.jpg
large-logo - 1.png
  • Select "SineIntegerGenerator1" and in the properties window set Amplitude:20, Frequency (Hz):0.1, Offset: 20
  • Select "SineIntegerGenerator2" and in the properties window set Amplitude:10, Frequency (Hz):0.1, Offset: 10
  • Double click on the "DisplayOLED1" and in the elements window drag "Draw Bitmap" to the left side, on the left side then select "Draw Bitmap1" and in the properties window select "Bitmap" field and click on the 3 dots.
    In the "Bitmap Editor" click on the "Load" button and load the bitmap (You can download the test bitmap attached here)
  • In the "Bitmap Editor" click on the "Load" button and load the bitmap (You can download the test bitmap attached here)
  • To animate the Bitmap movement, we need to control the X and Y properties. To do that we will add pins to them:
    In the Object Inspector select the "X" property
    Click on the "Pin" button at front of the property,From the Drop Down list select the "Integer SinkPin"
    Do the same for the "Y" property
    Close the "Elements" dialog
    You will see the new "X", and "Y" pins added to the "Elements.Draw Bitmap1" element

In Visuino Connect Components

2020-04-27_12-33-24.jpg
oled3.png
  • Connect "SineIntegerGenerator1" pin[Out] to "DisplayOLED1">"Draw Bitmap1" pin[X]
  • Connect "SineIntegerGenerator2" pin [Out] to "DisplayOLED1">"Draw Bitmap1" pin[Clock]
  • Connect "SineIntegerGenerator2" pin [Out] to "DisplayOLED1">"Draw Bitmap1" pin[Y]
  • Connect "DisplayOLED1" pin [Reset] to Arduino digital pin[9]
  • Connect "DisplayOLED1" pin [Data Command] to Arduino digital pin[9]
  • Connect "DisplayOLED1" pin [Out SPI] to Arduino pin[SPI In]
  • Connect "DisplayOLED1" pin [Chip Select] to Arduino digital pin[7]

Generate, Compile, and Upload the Arduino Code

2020-10-30_13-20-50.jpg

In Visuino, at the bottom click on the "Build" Tab, make sure the correct port is selected, then click on the "Compile/Build and Upload" button.

Play

If you power the Arduino UNO module, and the OLED display you will see the Bitmap moving around the OLED Display as seen on the Video.

Congratulations! You have completed your project with Visuino. Also attached is the Visuino project, that I created for this Instructable, you can download it here and open it in Visuino: https://www.visuino.eu