[GUIDE] Battery icon indicator guide with MCP3008

Various user-contributed guides for hardware-related things
krevett
Posts: 2
Joined: Wed Jun 07, 2017 12:55 am

Re: [GUIDE] Battery icon indicator guide with MCP3008

Post by krevett » Wed Jun 14, 2017 2:55 am

activex wrote:
Sat Jun 10, 2017 2:05 am
krevett wrote:
Wed Jun 07, 2017 1:20 am
1/ On this picture, we can see a grey wire connected to #21 on pi gpio, but going nowhere. Do you have an explanation?
Just an editing error, its not supposed to be there in the first place ;)
krevett wrote:
Wed Jun 07, 2017 1:20 am
2/ Your white wire is going to CS0 pin, but I can't find it on this GPIO chart ? Does-it correspond to SPI_CE0_N (gpio 8/pin24) ?
I don't have a RPi3, so cant answer that, but try googling RPI 3 SPI.
Thanks for your answer !
It looks to be the same for the SPI_CE0_N. I'll have a try in the beginning of july (I'm waiting for parts).

User avatar
jostie94
Posts: 51
Joined: Sat Apr 01, 2017 3:34 am
Location: the netherlands
Has thanked: 5 times
Been thanked: 28 times

Re: [GUIDE] Battery icon indicator guide with MCP3008

Post by jostie94 » Tue Jun 27, 2017 7:06 am

Does anyone have an idea what I'm doing wrong?
I do don't know anymore :(

pi@retropie:~/gbzbatterymonitor $ python main.py
Batteries 100% voltage: 4.1
Batteries 75% voltage: 3.76
Batteries 50% voltage: 3.63
Batteries 25% voltage: 3.5
Batteries dangerous voltage: 3.2
ADC 100% value: 937.441786284
ADC 75% value: 859.702711324
ADC 50% value: 829.978947368
ADC 25% value: 800.255183413
ADC dangerous voltage value: 731.661881978
/home/pi/raspidmx/pngview/pngview: error while loading shared libraries: libraspidmx.so.1: cannot open shared object file: No such file or directory
ADC value: 313 (1.36893833705 V)
ADC value: 311 (1.36019112723 V)
^Cpngview: no process found
my GBZ builds:
1) http://www.sudomod.com/forum/viewtopic.php?f=9&t=3197
------------------------------------------------------------------------------------------

User avatar
tinkerBOY
Posts: 710
Joined: Tue May 30, 2017 4:00 am
Has thanked: 294 times
Been thanked: 206 times

Re: [GUIDE] Battery icon indicator guide with MCP3008

Post by tinkerBOY » Thu Jul 13, 2017 11:35 am

jostie94 wrote:
Tue Jun 27, 2017 7:06 am
Does anyone have an idea what I'm doing wrong?
I do don't know anymore :(

pi@retropie:~/gbzbatterymonitor $ python main.py
Batteries 100% voltage: 4.1
Batteries 75% voltage: 3.76
Batteries 50% voltage: 3.63
Batteries 25% voltage: 3.5
Batteries dangerous voltage: 3.2
ADC 100% value: 937.441786284
ADC 75% value: 859.702711324
ADC 50% value: 829.978947368
ADC 25% value: 800.255183413
ADC dangerous voltage value: 731.661881978
/home/pi/raspidmx/pngview/pngview: error while loading shared libraries: libraspidmx.so.1: cannot open shared object file: No such file or directory
ADC value: 313 (1.36893833705 V)
ADC value: 311 (1.36019112723 V)
^Cpngview: no process found
Copy the file libraspidmx.so.1 to /lib directory.
New! tinkerBOY PowerSwitch v1.0 with Safe Shutdown
Game Boy Zero Controllers available @ tinkerBOY.xyz * Support
tinkerBOY Controller v3.0 - built-in usb controller, usb audio, and usb hub
tinkerBOY Controller v2.0 - GPIO buttons and builtin PWM Audio and Amplifier
tinkerBOY Controller v1.1 - simple pcb button
* DPI Adapter - better display for GBZ
* keyboard converters - IBM XT/AT Soarer's Converter | ADB to USB Converter

User avatar
tinkerBOY
Posts: 710
Joined: Tue May 30, 2017 4:00 am
Has thanked: 294 times
Been thanked: 206 times

Re: [GUIDE] Battery icon indicator guide with MCP3008

Post by tinkerBOY » Thu Jul 13, 2017 11:38 am

The Pngview icon will not appear on the Emulationstation homescreen but appears just fine on any games. Any ideas why?
New! tinkerBOY PowerSwitch v1.0 with Safe Shutdown
Game Boy Zero Controllers available @ tinkerBOY.xyz * Support
tinkerBOY Controller v3.0 - built-in usb controller, usb audio, and usb hub
tinkerBOY Controller v2.0 - GPIO buttons and builtin PWM Audio and Amplifier
tinkerBOY Controller v1.1 - simple pcb button
* DPI Adapter - better display for GBZ
* keyboard converters - IBM XT/AT Soarer's Converter | ADB to USB Converter

User avatar
HoolyHoo
Posts: 766
Joined: Sat Jul 09, 2016 9:34 pm
Has thanked: 206 times
Been thanked: 741 times

Re: [GUIDE] Battery icon indicator guide with MCP3008

Post by HoolyHoo » Thu Jul 13, 2017 12:49 pm

zeroboy wrote:
Thu Jul 13, 2017 11:38 am
The Pngview icon will not appear on the Emulationstation homescreen but appears just fine on any games. Any ideas why?
Perhaps you are not using a layer number that is high enough within the pngview switch to be the upmost layer.

User avatar
tinkerBOY
Posts: 710
Joined: Tue May 30, 2017 4:00 am
Has thanked: 294 times
Been thanked: 206 times

Re: [GUIDE] Battery icon indicator guide with MCP3008

Post by tinkerBOY » Thu Jul 13, 2017 7:45 pm

HoolyHoo wrote:
Thu Jul 13, 2017 12:49 pm
zeroboy wrote:
Thu Jul 13, 2017 11:38 am
The Pngview icon will not appear on the Emulationstation homescreen but appears just fine on any games. Any ideas why?
Perhaps you are not using a layer number that is high enough within the pngview switch to be the upmost layer.
Yeah. I tried to check the layers via:

Code: Select all

vcgencmd dispmanx_list
It looks like emulationstation uses layer 10000 so i just changed pngview's layer to 11000 and everything works now.
New! tinkerBOY PowerSwitch v1.0 with Safe Shutdown
Game Boy Zero Controllers available @ tinkerBOY.xyz * Support
tinkerBOY Controller v3.0 - built-in usb controller, usb audio, and usb hub
tinkerBOY Controller v2.0 - GPIO buttons and builtin PWM Audio and Amplifier
tinkerBOY Controller v1.1 - simple pcb button
* DPI Adapter - better display for GBZ
* keyboard converters - IBM XT/AT Soarer's Converter | ADB to USB Converter

User avatar
ABH
Posts: 188
Joined: Sat May 28, 2016 7:01 pm
Location: Qatar
Has thanked: 82 times
Been thanked: 113 times

Re: [GUIDE] Battery icon indicator guide with MCP3008

Post by ABH » Sun Jul 30, 2017 9:28 pm

Awesome
is it possible to use Battery indicator with SPI screen ?

User avatar
BadBert
Posts: 377
Joined: Wed Jun 29, 2016 4:14 am
Location: Hoogerheide, Netherlands
Has thanked: 100 times
Been thanked: 61 times
Contact:

Re: [GUIDE] Battery icon indicator guide with MCP3008

Post by BadBert » Mon Jul 31, 2017 12:24 am

Is it possible to use a buttion in the + line to the chip, so it will only display the icon when you push the switch?

i don't like the icon to be always on top....
Also, i have the safe shutdown in it for safety :D

Can someone tell me how to wire it up to the Pi0?
I see some gpoPin numbers... but i already am using gpoPins 17, 22 and 27 for my safeshutdown...
My first GBZ build -=HERE=- -> Became a gift to my little brother!
My 2nd GBZ build -=WIP HERE=- -> going with HDMI!

RocknRollaDE
Posts: 4
Joined: Wed Aug 30, 2017 6:44 am
Has thanked: 2 times
Been thanked: 2 times

Re: [GUIDE] Battery icon indicator guide with MCP3008

Post by RocknRollaDE » Thu Oct 19, 2017 8:48 am

hello from germany.

looks like i'm having some permission problems.
anyone got a clue how to fix this ?

Code: Select all

pi@retropie:~/gbzbattery $ python main.py
Batteries 100% voltage:         4.1
Batteries 75% voltage:          3.76
Batteries 50% voltage:          3.63
Batteries 25% voltage:          3.5
Batteries dangerous voltage:    3.2
ADC 100% value:                 937.441786284
ADC 75% value:                  859.702711324
ADC 50% value:                  829.978947368
ADC 25% value:                  800.255183413
ADC dangerous voltage value:    731.661881978
sh: 1: /home/pi/raspidmx/pngview: Permission denied
ADC value: 860 (3.76130022321 V)
Changed battery icon to 100%
sh: 1: /home/pi/raspidmx/pngview: Permission denied
ADC value: 833 (3.64321289063 V)
Changed battery icon to 75%
sh: 1: /home/pi/raspidmx/pngview: Permission denied
ADC value: 847 (3.70444335937 V)
ADC value: 862 (3.77004743304 V)
directory structure
all directorys are owned by the user pi

/home/pi/raspidmx
/home/pi/raspidmx/pngview
/home/pi/gbzbattery

RocknRollaDE
Posts: 4
Joined: Wed Aug 30, 2017 6:44 am
Has thanked: 2 times
Been thanked: 2 times

Re: [GUIDE] Battery icon indicator guide with MCP3008

Post by RocknRollaDE » Thu Oct 19, 2017 9:08 am

problem solved!
just edited the root login to gain access with it.
copied the libraspidmx.so.1 to /usr/lib and everything is working fine.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest