How to control SSD1306 128X32 OLED display in matlab?

56 ビュー (過去 30 日間)
Ashish Sahu
Ashish Sahu 2020 年 3 月 23 日
コメント済み: yulin 2024 年 1 月 5 日
I want to display text on SSD1306 128X32 OLED display using matlab. I have the matlab and simulink support package for arduino already but I cannot find any documentation regarding the control of above mentioned display. I connected the display to matlab via arduino uno, made object named dev and tried various things but nothing seems to work. It will be helpful if anyone can show me how to print 'HELLO WORLD' on the display.
>> a=arduino()
a =
arduino with properties:
Port: 'COM4'
Board: 'Uno'
AvailablePins: {'D2-D13', 'A0-A5'}
AvailableDigitalPins: {'D2-D13', 'A0-A5'}
AvailablePWMPins: {'D3', 'D5-D6', 'D9-D11'}
AvailableAnalogPins: {'A0-A5'}
AvailableI2CBusIDs: [0]
Libraries: {'I2C', 'SPI', 'Servo'}
>> dev = device(a,'I2CAddress','0x3C'); % display object
>> write(dev,[hex2dec(81) hex2dec(FF)]); % controlling the contrast

回答 (2 件)

Arash Mohammadzadeh Gonabadi
Arash Mohammadzadeh Gonabadi 2022 年 7 月 25 日
I have the same issue.

ali
ali 2023 年 1 月 16 日
this code works in my board for turning display on:
>> a = arduino('COM7','mega2560','Libraries','I2C');
>> dev = device(a,'I2CAddress','0x3c');
>> writeRegister(dev,0x00,0xaf,'uint16');
  3 件のコメント
ali
ali 2023 年 7 月 12 日
It is not size dependent, you have to care about slave address of your display
yulin
yulin 2024 年 1 月 5 日
What should i have to do if my OLED display is Serial Peripheral Interface?

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeArduino Hardware についてさらに検索

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by