Coder Social home page Coder Social logo

Comments (5)

antiprism avatar antiprism commented on September 24, 2024

Hi Rikardo

I recently updated mpd_oled to make it compatible with moOde 5.0.

Regarding the display, SPI isn't well supported and involves modifying the mpd_oled source to include the configuration, specifically the init_display function in display.cpp. Also, I cannot confirm that other changes won't be needed as I have had no feedback from anyone that has used mpd_oled with SPI. If the display can also work with i2c then that would be a better option.

The controller chip also needs to be supported by mpd_oled, and should be SSD1306 or SH1106, so it might be an idea to check that first.

Adrian.

from mpd_oled.

rikardo1979 avatar rikardo1979 commented on September 24, 2024

Thanks for your reply here. I do have the display working on moOde like this http://tinyw.in/rCv2

I will take it a part and find more details about it

from mpd_oled.

antiprism avatar antiprism commented on September 24, 2024

Looking at the configuration file from the OLED package referenced in your link, you have

from luma.oled.device import ssd1306
import RPi.GPIO as GPIO
serial = spi(port=0, device=0, gpio_DC=27, gpio_RST=24)
device = ssd1306(serial, rotate=2)

In which case...

In main.cpp, add a line near the beginning of the main function to override whatever OLED you set with -o, which should then ensure SPI initialisation for your display

OledOpts opts;
opts.process_command_line(argc, argv);
opts.oled = OLED_ADAFRUIT_SPI_128x64;  // ADD THIS LINE

In display.cpp, add the SPI configuration

bool init_display(ArduiPi_OLED &display, int oled, unsigned char i2c_addr,
    int reset_gpio, bool rotate180)
{
 
// SPI
  if (display.oled_is_spi_proto(oled)) {
    // SPI change parameters to fit to your LCD
    if ( !display.init(27, 24, OLED_SPI_CS, oled) )     // INCLUDE THESE SETTINGS
      return false;
  }

I am not sure if OLED_SPI_CS will need changing.

I haven't built these changes, so they may include syntax errors. Also, even with the correct initialisation there may be other changes required to get this display working.

Adrian.

from mpd_oled.

antiprism avatar antiprism commented on September 24, 2024

Maybe your OLED isn't connected like the original configuration in the OLED package, as is the case in this message: http://moodeaudio.org/forum/showthread.php?tid=664&pid=9235#pid9235

In which case, edit the display.init() function cal according to your configuration (the first argument is the DC GPIO number, and the second is the RESET GPIO number).

from mpd_oled.

antiprism avatar antiprism commented on September 24, 2024

Closing. Reopen if the issue remains.

from mpd_oled.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.