Go to advanced search

by RogerW
Wed Nov 27, 2019 10:30 am
Forum: Python
Topic: Display full screen image using Python?
Replies: 5
Views: 335

Re: Display full screen image using Python?

Paddyg beat me to it but this should run

Code: Select all

import tkinter as tk

main = tk.Tk()
main.attributes('-fullscreen',True)
tk.Button(main,text='Quit',command=main.destroy).pack()
main.mainloop()
by RogerW
Mon Aug 26, 2019 10:35 am
Forum: C/C++
Topic: Reading different channels from MCP3008 with pigpio
Replies: 3
Views: 723

Re: Reading different channels from MCP3008 with pigpio

I have some C++ code which (among other things) reads data from a MCP3008. It uses the pigpio c library not the daemon. Header file [// Rpio.h // Written by Roger Woollett // // Low level interface to hsrdware via gpio // Uses the pigpio library and the base class // PioBase ensures that the library...
by RogerW
Wed Jul 24, 2019 9:15 am
Forum: Raspbian
Topic: Buster bug report thread
Replies: 286
Views: 54578

Re: Buster bug report thread

sudo apt-get install pigpio fails on buster lite. I have a C program that needs libpigpio.so which does not appear to be included with buster lite. On stretch install pigpio worked. On buster I get "Temporary failure resolving....". I have tried several times and tried the suggested options but it s...
by RogerW
Fri Apr 26, 2019 8:52 am
Forum: C/C++
Topic: Low voltage detection
Replies: 10
Views: 2607

Re: Low voltage detection

Thanks for that information. Because I wanted to detect transient low voltage blips I was hoping for an "interupt" type of solution rather than polling. I have now decided it is not worth pursuing unless it definitely proves to be a problem which I supect is unlikely.
by RogerW
Wed Apr 10, 2019 2:13 pm
Forum: C/C++
Topic: Low voltage detection
Replies: 10
Views: 2607

Re: Low voltage detection

Fair enough. Thanks for the information.
by RogerW
Wed Apr 10, 2019 1:42 pm
Forum: C/C++
Topic: Low voltage detection
Replies: 10
Views: 2607

Re: Low voltage detection

Thanks for that. It would be nice to get that information directly from a program but I cannot find any mention of such. Do you know how vcgencmd gets its data?
by RogerW
Wed Apr 10, 2019 10:59 am
Forum: C/C++
Topic: Low voltage detection
Replies: 10
Views: 2607

Re: Low voltage detection

Thanks for the comments. In fact I am more concerned by transients which may in fact be unlikely. I have four cells which deliver a nominal 6 volts. The motors are driven from this via an H bridge. The pi is fed from an up/down regulator supplied from the same source so SHOULD be ok but I wanted to ...
by RogerW
Mon Apr 08, 2019 2:25 pm
Forum: C/C++
Topic: Low voltage detection
Replies: 10
Views: 2607

Low voltage detection

If the processor detects a low supply voltage a lightning symbol is shown on the screen. I have a battery powered robot using a pi zero W with no screen. Is there a way my program can recieve an interrupt or other indication that the voltage is low.
by RogerW
Wed Mar 13, 2019 4:40 pm
Forum: C/C++
Topic: New to Raspberry, old to programming
Replies: 40
Views: 6155

Re: New to Raspberry, old to programming

Like you I retired a while ago (17 years). I have mainly used python on the pi but recently gone back to C++ for a robot project. I would suggest you don't discount doing all the development on the pi. I have a B+ so not the fastest and have found it to be practical. I use codeblocks which is a basi...
by RogerW
Wed Mar 13, 2019 11:42 am
Forum: C/C++
Topic: CodeBlocks and pigpio
Replies: 11
Views: 1077

Re: CodeBlocks and pigpio

joan - thanks for the clarification. I could compile with codeblocks and then run the app from a console but that would be clumsy and I could not use the debugger built into codeblocks. For the moment I have modified the desktop entry for file manager to run that sudo as well as codeblocks which doe...
by RogerW
Tue Mar 12, 2019 6:05 pm
Forum: C/C++
Topic: CodeBlocks and pigpio
Replies: 11
Views: 1077

Re: CodeBlocks and pigpio

Its there as standard, compile with -lpigpio. See http://abyz.me.uk/rpi/pigpio/cif.html
by RogerW
Tue Mar 12, 2019 5:55 pm
Forum: C/C++
Topic: CodeBlocks and pigpio
Replies: 11
Views: 1077

Re: CodeBlocks and pigpio

I am not using pigpiod. I am using the C pigpio library which controls the gpios directly.
by RogerW
Tue Mar 12, 2019 5:46 pm
Forum: C/C++
Topic: CodeBlocks and pigpio
Replies: 11
Views: 1077

Re: CodeBlocks and pigpio

Again true but I am not using wiringpi. I am using the pigpio C interface library.
by RogerW
Tue Mar 12, 2019 4:32 pm
Forum: C/C++
Topic: CodeBlocks and pigpio
Replies: 11
Views: 1077

Re: CodeBlocks and pigpio

True for the daemon but I am not using it. I link direct to the C library. I may have missed something but the first time I ran the program I was told I needed sudo.
by RogerW
Tue Mar 12, 2019 11:15 am
Forum: C/C++
Topic: CodeBlocks and pigpio
Replies: 11
Views: 1077

CodeBlocks and pigpio

I am learning to use codeblocks to develop an application that uses the pigpio library. the using the pigpio library means the application needs to run as sudo. I can do this by running codeblocks as sudo but then all the files it creates need sudo privileges if I want to delete them. Is there a way...
by RogerW
Wed Feb 13, 2019 10:16 am
Forum: Python
Topic: tkinter Drop Down Menu Program (convert to Python 3)
Replies: 5
Views: 1371

Re: tkinter Drop Down Menu Program (convert to Python 3)

This is a "template" python 3 program that uses includes a menu. It might help. import tkinter as tk import tkinter.messagebox as msg class Mainframe(tk.Frame): # Mainframe contains the widgets # More advanced programs may have multiple frames # or possibly a grid of subframes def __init__(self,mast...
by RogerW
Fri Nov 30, 2018 3:11 pm
Forum: Python
Topic: Thonny complains object has no attribute '_w'
Replies: 1
Views: 418

Thonny complains object has no attribute '_w'

I have a simple tkinter program to try out Thonny 3 debug. import tkinter as tk class Mainframe(tk.Frame): def __init__(self,master,*args,**kwargs): tk.Frame.__init__(self,master,*args,**kwargs) class App(tk.Tk): def __init__(self): tk.Tk.__init__(self) self.title('Simple test') self.geometry('300x1...
by RogerW
Thu Jul 26, 2018 3:02 pm
Forum: Python
Topic: Python Tkinter GPIO User Interface
Replies: 26
Views: 37835

Re: Python Tkinter GPIO User Interface

This is a more primitive monitor but does use pigpio. You can run it on the same machine (localhost) or over a network. # PyMon.py # Program to monitor GPIO pins on a raspberry pi # can be run on the pi or a remote machine # It uses pigpio and needs the pigpiod deamon # to be running on the target m...
by RogerW
Mon Jul 09, 2018 5:07 pm
Forum: C/C++
Topic: WiringPi and interrupts - multiple pins
Replies: 2
Views: 746

Re: WiringPi and interrupts - multiple pins

OK I have had a go but failed. #include <iostream> #include <vector> #include <wiringPi.h> void respond(const int i) { static int count = 0; std::cout << "pin " << i << "count " << count <<std::endl; count++; } int main(int argc, char **argv) { wiringPiSetupGpio(); std::vector<int> list = {2,3}; //s...
by RogerW
Sun Jul 08, 2018 11:33 am
Forum: C/C++
Topic: WiringPi and interrupts - multiple pins
Replies: 2
Views: 746

Re: WiringPi and interrupts - multiple pins

I suspect it is possible to do this using lambdas but my C++ is too rusty and out of date to be sure.
Maybe someone else can comment.
by RogerW
Tue May 22, 2018 1:29 pm
Forum: Python
Topic: GUI, gauge and touchscreen
Replies: 4
Views: 2394

Re: GUI, gauge and touchscreen

There is some code here which you might find useful.
viewtopic.php?f=38&t=134854#p897766
by RogerW
Mon Apr 30, 2018 9:28 am
Forum: Python
Topic: multiple pigpio pi objects
Replies: 7
Views: 946

Re: multiple pigpio pi objects

Thanks Joan.
by RogerW
Mon Apr 30, 2018 9:14 am
Forum: Python
Topic: multiple pigpio pi objects
Replies: 7
Views: 946

Re: multiple pigpio pi objects

Thanks for the comment Dougie. In the end I opted for the easy way out and passed the pi object through the constructor. This means I can have local and remote objects but puts the onus on caller to create and stop the pi objects. It also meant fewer changes to my code. I would still like to know if...
by RogerW
Mon Apr 30, 2018 9:09 am
Forum: Python
Topic: Very odd error on program termination
Replies: 10
Views: 1256

Re: Very odd error on program termination

Probably not that then.
by RogerW
Sun Apr 29, 2018 5:18 pm
Forum: Python
Topic: Very odd error on program termination
Replies: 10
Views: 1256

Re: Very odd error on program termination

How are you trapping the exit button? Do you have something like

Code: Select all

        bind('<Destroy>',on_destroy)
I have found that on_destroy gets called multiple times. I had to use a once only flag to stop cleanup code being executed more than once.

Go to advanced search