Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Instruction Guide 128x64 OLED with Song Status and Spectrum Display on Raspberry Pi
#66
Hi Bob

You will need to modify the code. Grab a separate copy of mpd_oled. The screen selection code is in main.cc

Code:
void draw_display(ArduiPi_OLED &display, const display_info &disp_info)
{
 if (disp_info.status.get_state() == MPD_STATE_UNKNOWN ||
     disp_info.status.get_state() == MPD_STATE_STOP)
   draw_clock(display, disp_info);
 else
   draw_spect_display(display, disp_info);
}

Change this to

Code:
void draw_display(ArduiPi_OLED &display, const display_info &disp_info)
{
 draw_clock(display, disp_info);
}

After building, change the name of the executable mpd_oled to mpd_oled_clock. Rename mpd_oled.service to mpd_oled_clock.service and edit it to call mpd_oled_clock (you may need to create a dummy fifo for the audio input, e.g.  mkfifo /tmp/dummy) . Now make an install_clock.sh script for mpd_oled_clock

Code:
sed 's/mpd_oled/mpd_oled_clock/g' install.sh > install_clock.sh
cat install_clock.sh

Review the install_clock.sh contents, printed by the second command above, then install with

Code:
sudo bash install_clock.sh

For your other display, you may be able to amend the draw display funcion to look like

Code:
void draw_display(ArduiPi_OLED &display, const display_info &disp_info)
{
 draw_spect_display(display, disp_info);
}

This would hopefully now show an emply spectrum display when stopped, which might be preferable to having two clocks.

This is all untested! (Sorry, I am short of time). The approach seems reasonable, but there may be issues or some extra steps needed.

Good luck!

Adrian.
Reply


Messages In This Thread
RE: 128x64 OLED with Song Status and Spectrum Display on Raspberry Pi - by adrii - 01-28-2019, 09:16 AM
RE: help me - by ghera78 - 02-28-2020, 08:01 AM
RE: help me - by ghera78 - 02-28-2020, 01:17 PM

Forum Jump: