Go to advanced search

by RogerW
Fri Apr 26, 2019 8:52 am
Forum: C/C++
Topic: Low voltage detection
Replies: 10
Views: 2183

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: 2183

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: 2183

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: 2183

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: 2183

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: 4951

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: 735

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: 735

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: 735

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: 735

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: 735

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: 735

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: 726

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: 315

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: 34838

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: 575

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: 575

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: 1751

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: 646

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: 646

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: 891

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: 891

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.
by RogerW
Sat Apr 28, 2018 9:06 am
Forum: Python
Topic: multiple pigpio pi objects
Replies: 7
Views: 646

multiple pigpio pi objects

I have a number of classes to control objects using pigpio. For example H bridge motor controller, Hitachi LCD and MCP3008 ADC. I have gone to some trouble to make all class objects use the same instance of pigpio.pi on the basis that that would set up fewer connections to the remote raspberry pi. A...
by RogerW
Wed Dec 13, 2017 3:58 pm
Forum: Raspberry Pi Desktop for PC and Mac
Topic: Cannot connect with SSH
Replies: 3
Views: 419

Re: Cannot connect with SSH

As a Linux novice my only experience is with Raspbian on the Pi. I suspect that the desktop has been ported to X86 Debian but other configuration changes have not. I had assumed the two systems would be more compatible. Another "incompatibility" is that on Raspbian I can supress the boot up splash s...
by RogerW
Wed Dec 13, 2017 2:49 pm
Forum: Raspberry Pi Desktop for PC and Mac
Topic: Cannot connect with SSH
Replies: 3
Views: 419

Re: Cannot connect with SSH

I have found a way to fix it.
Edit the file /etc/ssh/sshd_config to comment out the line
PasswordAuthentication no

This now seems to work like Raspbian but it would be nice if someone could fill in the background.

Go to advanced search