I need some docs on the speakerphat. The one-liner install works and the tests work but there’s no info on how to actually get control of the thing. I want to control it from a c++ app. I just can’t seem to locate any useful documentation.
Depends ofcourse what you want to achieve with your speakerphat. What do you want todo ? I
am running speakerphat on top of the features I get using phatbeat software, that is streaming internet radio stations .
You’ve likely already looked at this but the pinout is here, https://pinout.xyz/pinout/speaker_phat#
I2S for the DAC (MAX98357A) , I2C for the VU meter.
There is some info on controlling the VU meter here, https://github.com/pimoroni/speaker-phat/tree/master/python and https://github.com/pimoroni/speaker-phat/blob/master/python/speakerphat.py
It’s python though, not c++
Poke around here and you may find some useful info, https://github.com/pimoroni/phat-beat. It’s for the pHat Beat but that uses the same DAC, just two of them for stereo.
There’s also this Arduino code for controlling the SN3218 (the LED driver chip used on Speaker pHAT) here: https://github.com/pimoroni/pimoroni_arduino_sn3218
It’s basically just the LEDs that you can control, the audio being handled by the Linux alsa audio stack.
I’d like to be able to control the volume for one thing. I’ve got most of what I want by making a system() call.
Looks like everything I need is here…
Yeah, the volume control is handled at the system level by alsa and alsamixer. There’s an example linked below that shows how to control volume level with Button SHIM that might be handy for you.
Now that I’m an old codger I seem to have developed a block against new languages. (New to me) I hate the way it’s getting hard to find C or C++ oriented stuff and getting around in linux is a challenge too. I pursue this stuff in an effort to keep my brain working as long as possible but I can see the handwriting on the wall.
Not getting any younger here either, I’ll be 60 this month. I had no coding skills so I guess you could say I was unbiased.;) Python seemed to what was most commonly used with the Raspberry Pi so I had at that. Learning curve seemed steep at first. I just kept plugging away at it. I’m no expert but I don’t find it near as frustrating as it was when I first started. I use Idle as my editor, and run the “check module” quit often. That will flag common errors like missing indent, unexpected indent, etc.
I do see some C and C++ stuff here and there. And I’ve heard it said its a lot easier language to learn than Python. Mostly by people that use it though.
Oh crap, sorry for the long winded reply, thought I was replying to another thread. Insert embarrassed smiley here.