Go to advanced search

by picandies
Thu Oct 25, 2018 10:58 pm
Forum: General discussion
Topic: Setting up gpio using classes
Replies: 24
Views: 1738

Re: Setting up gpio using classes

Hi Scotty: Perhaps you need to take a python tutorial so that you understand how classes work Why are you sounding so acidic? That why I posted the question--for some help on setting up I/o using several classes. You seemed very focused about the particular chips & upset that I was bit-banging an sp...
by picandies
Wed Oct 24, 2018 11:48 pm
Forum: General discussion
Topic: Setting up gpio using classes
Replies: 24
Views: 1738

Re: Setting up gpio using classes

I agree there should be an initial setup and initialization ...setting in/outs, pin name, pullup etc. That should happen only once & never again. Thereafter when a class needs to look at the at pin state to possibly take some action, how can it have access to the already defined pin ( without redoin...
by picandies
Wed Oct 24, 2018 8:23 pm
Forum: General discussion
Topic: Setting up gpio using classes
Replies: 24
Views: 1738

Re: Setting up gpio using classes

I'm not sure why this is focusing on spi,i2c forget them for now. I have a trigger pin that must be known to two of my sensor classes. How do you define/set that up so that both classes can tell the line is high? Not sure why this is such a tough question to get an answer. Where does it get set up? ...
by picandies
Wed Oct 24, 2018 2:31 pm
Forum: General discussion
Topic: Setting up gpio using classes
Replies: 24
Views: 1738

Re: Setting up gpio using classes

We haven't gotten anywhere. You still haven't answered the question...first the spi lines are bit-banged in each class. Also, the other pin (trigger_signal) goes to both boards of electronics to act as a trigger signal for that board's electronics. If the same pin is needed in multiple classes, how ...
by picandies
Wed Oct 24, 2018 8:34 am
Forum: Compute Module
Topic: Setting up compute 3
Replies: 7
Views: 3505

Re: Setting up compute 3

That link takes you to about the worst installation guide ever written. It jumps all over the place. For those who just want to enable the Compute Module eMMC as a mass storage device under Windows ...as opposed to what ? What is being said here? rather than trying to use /dev/sda etc. from Cygwin. ...
by picandies
Wed Oct 24, 2018 8:19 am
Forum: General discussion
Topic: Setting up gpio using classes
Replies: 24
Views: 1738

Re: Setting up gpio using classes

I think that is what I'm hoping to do. Seems ridiculous for each class to redefine all of the I/o's over & over. However, of course, each class must make use of the I/o's needed for what ever device(s) it is controlling. So do you have an example of how to set up? I haven't seen anything yet.
by picandies
Wed Oct 24, 2018 4:36 am
Forum: General discussion
Topic: Setting up gpio using classes
Replies: 24
Views: 1738

Re: Setting up gpio using classes

Is that what is usually done for setting up the I/0 for all of the classes that use the I/O's?? Are there some examples or tutorials for this question? Once you declare GPIO11 as an output called doggy, you shouldn't need to (or want to) declare it again. Most examples I see barely even mention clas...
by picandies
Wed Oct 24, 2018 3:31 am
Forum: General discussion
Topic: Setting up gpio using classes
Replies: 24
Views: 1738

Re: Setting up gpio using classes

Not sure what the chips have to do with it, the topic is the same regardless of what part is used. Have an adc CS5511, an BU2505 DAC & MPL115A1 pressure sensor, to name a few. So want some classes: The serial lines are shared & some gpios are shared in some of the classes. Where to define all of the...
by picandies
Tue Oct 23, 2018 4:58 pm
Forum: General discussion
Topic: Setting up gpio using classes
Replies: 24
Views: 1738

Re: Setting up gpio using classes

Do you means something like this--I want both classes to be able to look at gpio3 Class motorcontrol(object): def __init__(self,OutputDevice): myPin = OutputDevice(3) myPin2 = OutputDevice(4) self.device1 = MyDeviceClass(myPin) self.device2 = MySecondDeviceClass(myPin, myPin2) def motor_check(self):...
by picandies
Tue Oct 23, 2018 8:19 am
Forum: Compute Module
Topic: cm3 module release from reset
Replies: 4
Views: 3350

Re: cm3 module release from reset

Powerup-wise the sequencing is fine...not so sure what happens when the power starts to fade out after the shutdown...a 5V (main) regulator with holdup drives the other regulators (3.3V, 1.8V, etc)...but it seems like the module is trying to restart (though gives up when the power completely fades).
by picandies
Tue Oct 23, 2018 6:56 am
Forum: Compute Module
Topic: cm3 module release from reset
Replies: 4
Views: 3350

Re: cm3 module release from reset

No, the run is floating, so it should be pulled up by the internal 10k. since it is high the whole time, doesn't seem like that would cause a restart, especially if power is dropping 10 sec after the shutdown command. When initially powered on , or after the RUN pin has been held low and then releas...
by picandies
Mon Oct 22, 2018 11:55 pm
Forum: Compute Module
Topic: cm3 module release from reset
Replies: 4
Views: 3350

cm3 module release from reset

What are the detailed "startup" conditions for the module to leave reset & begin running?...By this, I mean I know applying +3.3V (along with some other voltages) starts it running. Is there some threshold it first crosses, then it waits xx ms before running? Is there something holding it in reset u...
by picandies
Mon Oct 22, 2018 6:31 pm
Forum: General discussion
Topic: Setting up gpio using classes
Replies: 24
Views: 1738

Re: Setting up gpio using classes

I'm taking a look at the gpiozero, but there is way way too much code to even know how it is all tying together. Say I have class A and class B They both need to look at GPIO18 (name it mysignal) Should each one define mysignal (set up pin name, direction pullups, etc) in it's init? Then it is being...
by picandies
Mon Oct 22, 2018 4:33 pm
Forum: General discussion
Topic: Setting up gpio using classes
Replies: 24
Views: 1738

Setting up gpio using classes

When setting up a system there may be many sensors & other I/o for switches, leds etc. Each sensor may be in its own file, using its own class & sub functions (read volts, read rpm, set pressure, set rpm, etc) The sensor classes are imported into the main file. Some lines (pins) may be shared among ...
by picandies
Sun Oct 21, 2018 3:01 am
Forum: General discussion
Topic: Best way to commonly setup io
Replies: 3
Views: 332

Re: Best way to commonly setup io

I got rid of the sample arrangement, since it was likely wrong. What is the proper setup of the classes to use the I/O s defined such that each of the different sensor classes can use them? Some sensors will be using the same io lines. Ser clk & data will be used by almost everybody. Other lines mig...
by picandies
Sat Oct 20, 2018 11:57 pm
Forum: General discussion
Topic: solid pwm for motor
Replies: 2
Views: 269

solid pwm for motor

Hello, I need a rock-solid (hardware PWM) for precise motion control, at only 1800-1980 Hz at the pin. Really it only needs to be 50% at all times. My understanding is just using some random I/O pin for PWM may give a lot of jumping (I have seen it myself) due to creating it in software, rather than...
by picandies
Sat Oct 20, 2018 4:01 pm
Forum: General discussion
Topic: Best way to commonly setup io
Replies: 3
Views: 332

Best way to commonly setup io

Hello: I have several classes for different sensors (pressure, rpm, adc, etc)...each of these use several I/O lines, some of them are somewhat shared (ex: ser data line is used everywhere & one switch line is read both pressure & current monitor activity). Some classes are in a different file & impo...
by picandies
Sun Oct 14, 2018 5:10 pm
Forum: General discussion
Topic: cumulative time error
Replies: 1
Views: 267

cumulative time error

I need to run a function 10 times a second in tkinter. Presently I use root.after(100, update_my_readings) However, I bet after 1000000 cycles, it will be off due to cumulative error (say each was 99.83 ms). What matters is not that it is exactly 100ms each time, but that it stays in synch with the ...
by picandies
Wed Sep 26, 2018 5:25 pm
Forum: Python
Topic: smbus read_block_data() definition
Replies: 13
Views: 1498

Re: smbus read_block_data() definition

Thank you Joan!!

I wonder how the Python lib can be poorly documented...how does everyone use it? Well, I suppose that's how it is.
by picandies
Wed Sep 26, 2018 1:58 am
Forum: Python
Topic: smbus read_block_data() definition
Replies: 13
Views: 1498

Re: smbus read_block_data() definition

Thanks for your reply...its fine for now...but I still wonder for my rpi3 running stretch Usually the 1st place I'd look is in the horse's mouth http://www.smbus.org/specs/], it doesn't give Python implementation I originally looked around there , but no answer to my question about the command param...
by picandies
Tue Sep 25, 2018 10:54 pm
Forum: Python
Topic: smbus read_block_data() definition
Replies: 13
Views: 1498

Re: smbus read_block_data() definition

It is pretty unlikely it actually accepts SMBus commands Its another processor I am programming, so it is whatever I program, but Iwas trying to use the mentioned function on the rpi end. I find it strange that there doesn't seem to be any readily accessable documentation on the rpi site, or any ot...
by picandies
Tue Sep 25, 2018 9:43 pm
Forum: Python
Topic: smbus read_block_data() definition
Replies: 13
Views: 1498

Re: smbus read_block_data() definition

s32 i2c_smbus_read_block_data ( struct i2c_client * client, u8 command, u8 * values); Thanks for the reply, though I'm not sure how it makes sense...This mean you'd do the following? using the 3 parameters/arguments given, an example gotvalues = mybus.i2c_smbus_read_block_data(20, 34, [1,2,3,4]) I'...
by picandies
Tue Sep 25, 2018 7:44 pm
Forum: Python
Topic: smbus read_block_data() definition
Replies: 13
Views: 1498

Re: smbus read_block_data() definition

Did you ask Python?

THANK YOU !!!!!...this is great...never thought of asking the rpi...I knew you could get help on Linux commands like help echo'

By the way where is this info actually defined/described in the real world (as an actual document rather then posts/comments)
by picandies
Tue Sep 25, 2018 4:17 pm
Forum: Python
Topic: smbus read_block_data() definition
Replies: 13
Views: 1498

Re: smbus read_block_data() definition

The device specifies the number of returned bytes, not the user ...this is a standard rpi3 with stretch, using python import smbus import sys import time bus=smbus.SMBus(1) get_my_data= bus.read_block_data(WHAT EXACTLY GOES IN HERE) WHAT are these parameters , please list & describe I need to read ...
by picandies
Tue Sep 25, 2018 1:26 am
Forum: Python
Topic: smbus read_block_data() definition
Replies: 13
Views: 1498

smbus read_block_data() definition

WHERE are the parameters for this function described/defined? I need a list of exactly what the needed parameters are. These must be exactly specified in a manual somewhere. By this I mean: readings=mybus.read_block_data( parameters) ...what are the parameter(s) Also some example of using it to read...

Go to advanced search