Go to advanced search

by picandies
Sat Jan 19, 2019 9:28 pm
Forum: General discussion
Topic: Tkinter destroy ...not always working
Replies: 0
Views: 153

Tkinter destroy ...not always working

Tkinter destroy ...not always working I have a form with a button that makes a popup a (smaller form with a few buttons): In the main window code makePopUpOne(p1) this calls: def makePopUpOne(p1): w.frmMotorCtrl = Frame(w.MainFrame) w.frmMotorCtrl.configure(relief=GROOVE)...various graphics commands...
by picandies
Thu Jan 03, 2019 7:13 pm
Forum: General discussion
Topic: make one-shot
Replies: 12
Views: 870

Re: make one-shot

I check it at various points in a large code, not just wait at one point. That might not be practical if the code is large..it might not be read often enough..then the timing would be off. Also, would the pin name definition be known everywhere in the program (such as in different classes). Seems l...
by picandies
Wed Jan 02, 2019 7:48 pm
Forum: General discussion
Topic: make one-shot
Replies: 12
Views: 870

Re: make one-shot

I just use time.time(). Set a start time and then keep checking against the current time eg. time.time() - start > 0.03. I am not sure of the accuracy. We cannot sit still in the code just checking the time, many other things need to be happening. At the time for stopping the pulse, we may be anywh...
by picandies
Wed Jan 02, 2019 4:32 pm
Forum: General discussion
Topic: make one-shot
Replies: 12
Views: 870

Re: make one-shot

Spawn a thread to generate the pulse via rpi.gpio. The thread can sleep during the pulse on time without holding up execution of the main program.

Do you have an example of doing it this way? I'm not sure I follow your statement, as I have never seen such a procedure.
by picandies
Wed Jan 02, 2019 2:10 am
Forum: General discussion
Topic: make one-shot
Replies: 12
Views: 870

Re: make one-shot

pigpio's gpio_trigger function looks like it does what you need. Thanks for the suggestion, however the limit is 100us [pulse_len:= 1-100] & I need a pulse about 30ms long, upon demand. Also everything else in my program uses rpi.gpio, so not sure if it is ok to mix such things together. Is there a...
by picandies
Tue Jan 01, 2019 10:01 pm
Forum: General discussion
Topic: make one-shot
Replies: 12
Views: 870

make one-shot

Hello: I'm doing some RPI3 Python math operations & when I get a certain result , need to make ONE 30ms (approx.) pulse on an IO pin (A one-shot) I'm using import RPi.GPIO as GPIO library for all my IO. I need the pulse to end without using a sleep command, since the program is very busy doing other...
by picandies
Wed Dec 12, 2018 12:14 am
Forum: Compute Module
Topic: strange i2c & VNC interaction
Replies: 3
Views: 803

Re: strange i2c & VNC interaction

I think this was a false alert...seems like activity on the rpi usb bus (wifi to PC) caused noise pickup on the i2c lines
by picandies
Tue Dec 11, 2018 11:46 pm
Forum: Compute Module
Topic: strange i2c & VNC interaction
Replies: 3
Views: 803

Re: strange i2c & VNC interaction

To clarify, using pins 28 & 29 (not sure whether the particular i2c matters), on the compute module
by picandies
Tue Dec 11, 2018 11:35 pm
Forum: Compute Module
Topic: strange i2c & VNC interaction
Replies: 3
Views: 803

strange i2c & VNC interaction

Using latest RPI3 Stretch, standard VNC & VNC Server on the windows PC Using the secondary I2C with smbus & to read some data on some chip, in a python3 script running in terminal window... bus.read_i2c_block_data ...seems to work ok , thousands of times over & over!!!!! Config the i2c as, follows.....
by picandies
Sat Dec 08, 2018 5:18 am
Forum: General discussion
Topic: need to force IO
Replies: 4
Views: 447

Re: need to force IO

danjperron--
Thank you so much...I'm going to give it a try...Need to get familiar with these 'pipes'
by picandies
Fri Dec 07, 2018 4:30 pm
Forum: General discussion
Topic: need to force IO
Replies: 4
Views: 447

Re: need to force IO

Do you have an example for suggestion "A" ...not sure about pipes Could program "B" simply "reset" all of the io settings (thereby stopping the pwm from "A")? How do you explain more about suggestion D (Two python applications could also use the processing library. It support shared memory from two ...
by picandies
Fri Dec 07, 2018 6:36 am
Forum: General discussion
Topic: need to force IO
Replies: 4
Views: 447

need to force IO

Using the rpi & RPi.GPIO in python. In program "A" I use GPIO.PWM to set up a PWM output pin, works great, the signal comes out fine A somewhat different & completely independent program "B" uses the same pin the same way (but different PWM settings). However, if program "A" is still running, the si...
by picandies
Sat Nov 24, 2018 2:12 am
Forum: General discussion
Topic: forum lookup gives junk
Replies: 3
Views: 530

forum lookup gives junk

Whenever I search the forum, the dates are all missing. I get 150 results & nothing has a date..then I pick one & it shows it was posted 6-7 years ago---NOT GOOD...How do I see the recent ones like last 1-3 years?? Picking the choice "last month" gives zero results, instead of 150. Why are no dates ...
by picandies
Mon Nov 19, 2018 5:52 pm
Forum: General discussion
Topic: Where's the pigpio tutorial?
Replies: 6
Views: 3558

Re: Where's the pigpio tutorial?

Yes everything is in Python. Not sure I follow you, is GPIOzero the same as pigpio, except in python? If they are not the same, what does one have to do with the other? Why use gpiozero instead of pigpio? what are the advantages/disadvantages? Is there a timing penalty?
by picandies
Mon Nov 19, 2018 8:39 am
Forum: General discussion
Topic: Where's the pigpio tutorial?
Replies: 6
Views: 3558

Where's the pigpio tutorial?

For the pigpio library, is there a solid tutorial (article, or step-by-step format) for getting things generally set up & working? I opened some of the code snips, but that's not so much an explanation & very few comments are within. The pigrpio site itself seems to have a vast array of commands & t...
by picandies
Sun Nov 18, 2018 4:12 pm
Forum: Python
Topic: Accessing IO in new class
Replies: 18
Views: 1790

Re: Accessing IO in new class

In the main code, I have a function that sets up the GPIO pins, states, and callbacks. This code, to setup GPIO, runs before any threading, class instantiations or, multiprocess are started. Exactly what I am looking for--how is it set up? How do the other classes access the set-up I/O? Please show...
by picandies
Sun Nov 18, 2018 2:48 am
Forum: General discussion
Topic: need to respond to output pin
Replies: 3
Views: 463

Re: need to respond to output pin

I'm looking into the pigpio library, but am wondering where a solid tutorial (article, or step-by-step format) is located, for getting things generally set up & working. I opened some of the code examples, but that's not really an explanation & very few comments are within. The pigrpio site itself s...
by picandies
Sat Nov 17, 2018 11:33 pm
Forum: Python
Topic: Accessing IO in new class
Replies: 18
Views: 1790

Re: Accessing IO in new class

Thank you MRyslab:

Sound like maybe this is simply not possible unless I use pigrpio. I may have to rip up my code and see if pigrpio does the trick.
by picandies
Sat Nov 17, 2018 9:17 pm
Forum: General discussion
Topic: need to respond to output pin
Replies: 3
Views: 463

need to respond to output pin

How can a program react quickly (milliseconds) to an output pin going high? The pin is being set high by another process. I tried setting up a callback to detect the change, but I get an error that I need to make my output an input! GPIO.add_event_detect(14,GPIO.RISING, callback=my_pin_shadower)
by picandies
Sat Nov 17, 2018 9:12 pm
Forum: Python
Topic: Accessing IO in new class
Replies: 18
Views: 1790

Re: Accessing IO in new class

Thanks for the update...however now your example is having each class setting up the pins, so now it will be back to the "pin is already define/in use error...I thought we were trying to only init/config/define them once. We want to set up & define all the io's and thereafter let each class use them...
by picandies
Sat Nov 17, 2018 8:00 pm
Forum: Python
Topic: Accessing IO in new class
Replies: 18
Views: 1790

Re: Accessing IO in new class

Thanks very much , gives me some ideas. One thing I noticed is the classes (pressuresensor & motors) in your example aren't using the io, since no methods are present Say there was a method .ReportPressure defined in PressureSensor to look at pin 17 & if the pin was high, read & print the pressure A...
by picandies
Sat Nov 17, 2018 6:12 pm
Forum: Python
Topic: Accessing IO in new class
Replies: 18
Views: 1790

Re: Accessing IO in new class

thanks for your help...I was wondering if you still have an example for your thought, doesn't matter which I/o lib is used. Why not create a class whose function is to initialize the GPIO library, offers methods to set the pin modes and ability to both read and write the pins. here is a strawman: my...
by picandies
Sat Nov 17, 2018 4:54 pm
Forum: Python
Topic: Accessing IO in new class
Replies: 18
Views: 1790

Re: Accessing IO in new class

Thanks for the code, though it isn't what we were talking about. All my codes use RPi.GPIO, and get the errors like this: RuntimeWarning: This channel is already in use, continuing anyway. This makes sense since the pin has already been defined by someone. So how do you do what you were proposing? W...
by picandies
Sat Nov 17, 2018 9:22 am
Forum: General discussion
Topic: need to respond to alarm signal pwm
Replies: 0
Views: 384

need to respond to alarm signal pwm

Hi, I'm generating a pwm signal on an I/O output that signals an alarm & that is working fine: self.GPIO.setup(self.PWMPIN,self.GPIO.OUT) self.mypwm=GPIO.PWM(self.PWMPIN,self.initpwmfreq) self.mypwm.start(0) I can see the pwm on the scope, just fine Now I also need the rpi to do something each time ...
by picandies
Sat Nov 17, 2018 8:06 am
Forum: Python
Topic: Accessing IO in new class
Replies: 18
Views: 1790

Re: Accessing IO in new class

Why not create a class whose function is to initialize the GPIO library, offers methods to set the pin modes and ability to both read and write the pins Do you have simple example to do that? I think that has been my thought. Say this class was called my_io_setups....wouldn't each class that used i...

Go to advanced search