Go to advanced search

by picandies
Wed Jan 02, 2019 2:10 am
Forum: General discussion
Topic: make one-shot
Replies: 12
Views: 562

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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...
by picandies
Fri Nov 16, 2018 3:52 am
Forum: Python
Topic: Accessing IO in new class
Replies: 18
Views: 1488

Re: Accessing IO in new class

Say there is one instance of each class, they'd each be defining the pin. I don't want each to define the pin but each needs to be able to read the pin. Say the pin was an "emergency stop" input & several classes need to react to that...how is it usually set up? I don't want "invent a problem" ,shou...
by picandies
Wed Nov 14, 2018 8:58 pm
Forum: Python
Topic: Accessing IO in new class
Replies: 18
Views: 1488

Accessing IO in new class

Hi I have a program running well, it uses a few io pins to read some status of the external world , such as a few pushbuttons. There is a class, in one file, called MotorSys which does the import RPi.GPIO as GPIO, and sets the names of the pins & direction for reading in the initialization, __init__...
by picandies
Sat Oct 27, 2018 9:09 pm
Forum: General discussion
Topic: Setting up gpio using classes
Replies: 24
Views: 1727

Re: Setting up gpio using classes

Thanks Heater, for the reply. The problem you seem to have is how to share a single resource around various parts of your program. Yes, I think it is exactly that. not sure how its done. I do wonder why you need to be messing with classes and object oriented programming. Do you really need many inst...
by picandies
Sat Oct 27, 2018 5:23 pm
Forum: General discussion
Topic: Setting up gpio using classes
Replies: 24
Views: 1727

Re: Setting up gpio using classes

Why are the devices not using the normal SPI pins? What design decision lead you to this scenario? Not sure, that's just how the boards are....anyhow, the bit banging works & speed is plenty fast. May hack into the traces on the hats, but don't really want to tear things up. So, how do I find the o...

Go to advanced search