Go to advanced search

by Grumpy Mike
Tue Oct 23, 2012 11:12 am
Forum: HATs and other add-ons
Topic: Gertboard vs. Arduino 32-bit Due
Replies: 27
Views: 17250

Re: Gertboard vs. Arduino 32-bit Due

Just to say the Due was launched yesterday and is now available from the Arduino store, Mouser and a few other distributors. http://store.arduino.cc/eu/index.php?main_page=product_info&cPath=11_12&products_id=243 http://www.mouser.com/ProductDetail/Arduino/A000062/?qs=%2fha2pyFadujh7tmx%252bTW1S5W5D...
by Grumpy Mike
Mon Oct 22, 2012 7:55 pm
Forum: Python
Topic: When to declare variables as global
Replies: 27
Views: 8125

Re: When to declare variables as global

But the values I initialised outside the function are available inside the function.
Does that mean that if I changed them inside the function they would not change?
Not that I was trying to when I had to make a global declaration.
by Grumpy Mike
Mon Oct 22, 2012 7:53 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Drive MAX7219 with I2C with shell script
Replies: 31
Views: 11144

Re: Drive MAX7219 with I2C with shell script

If you want to know what to type then:- i2cset -y 'bus number' 'i2c address' 'control reg' data Assuming all external address bits are wired up to zero then the address is 0x20 page 6 of the data sheet. Assuming you are on a revision 1 of the Pi board then the bus number is 0 So first configure it:-...
by Grumpy Mike
Mon Oct 22, 2012 4:27 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Drive MAX7219 with I2C with shell script
Replies: 31
Views: 11144

Re: Drive MAX7219 with I2C with shell script

Output the bit pattern of 0000 00101 to the port port you have the LEDs connected to. That is 0x05.

Sorry the bit about the PWM I said before was wrong I was mixing this chip up with the PCA9685
by Grumpy Mike
Mon Oct 22, 2012 4:14 pm
Forum: Python
Topic: When to declare variables as global
Replies: 27
Views: 8125

Re: When to declare variables as global

Well I tried that I have a list I declare outside any function so it is global. I use it at the global level but then I also use it in three function definitions and python doesn't complain about it not being declared.
by Grumpy Mike
Mon Oct 22, 2012 3:21 pm
Forum: Python
Topic: When to declare variables as global
Replies: 27
Views: 8125

When to declare variables as global

Being a bit new to Python I am puzzled about when to declare variables as global inside function definitions. It seems that most of the time you don't need to but occasionally you do. I haven't been able to fathom out what causes the requirement. Is there a simple rule? Or should you always declare ...
by Grumpy Mike
Mon Oct 22, 2012 12:51 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: I2C bus first byte MSB missing ..
Replies: 8
Views: 2730

Re: I2C bus first byte MSB missing ..

I am interacting my PI with a slave device [PC],
Can you say more about what this slave device is? It is not just a PC it must be a PC with some sort of interface running some sort of code.
by Grumpy Mike
Mon Oct 22, 2012 12:47 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Drive MAX7219 with I2C with shell script
Replies: 31
Views: 11144

Re: Drive MAX7219 with I2C with shell script

But if I will need only like 10 different symols on it, then it really doesn't matter?? Not sure I understand that, a matrix is a matrix it matters not what is displayed on it you don't drive it any differently depending on what is displayed. And I still haven’t figured out, can I control them from...
by Grumpy Mike
Mon Oct 22, 2012 9:17 am
Forum: Python
Topic: Keyboard interrupts other than Ctrl-C
Replies: 5
Views: 3764

Re: Keyboard interrupts other than Ctrl-C

You can use pygame.event in the pygame module to trap keystrokes.
See page 28 of issue 3 of the MagPi for an example.
by Grumpy Mike
Mon Oct 22, 2012 9:13 am
Forum: Python
Topic: Looking for a good Samaritan
Replies: 6
Views: 1463

Re: Looking for a good Samaritan

Have you read these:-
http://www.themagpi.com/
They have Python projects and lots of links. They are also free to download.
by Grumpy Mike
Mon Oct 22, 2012 9:01 am
Forum: Python
Topic: WiringPi PWM in Python
Replies: 11
Views: 4768

Re: WiringPi PWM in Python

Will wiringpi for Python handle pwm for 2 motors and if so how (source)? The Raspberry Pi only has one PWM output that is wired out to the GPIO pins. The second PWM is wired up to the speaker jack but you will need to remove the output filter and solder a wire direct onto the board to get at it. If...
by Grumpy Mike
Mon Oct 22, 2012 8:55 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Using a Piezo
Replies: 19
Views: 16197

Re: Using a Piezo

I have a piezo transducer There are two sorts of these:- 1) The one you just need to supply a voltage to and it will make a noise. This sort you could connect directly to a GPIO pin. 2) The one that is more like a speaker that you need to send a succession of high and low signals to make a noise. T...
by Grumpy Mike
Mon Oct 22, 2012 8:52 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Max number of 'lit' LEDs via MCP23017?
Replies: 5
Views: 3223

Re: Max number of 'lit' LEDs via MCP23017?

I suppose driving the LED between the output pin (high) and ground is sourcing.
Yes
If you connect the LED between the power supply and the output pin and make the output low then the current flows the other way and that's sinking?
Yes :)
by Grumpy Mike
Mon Oct 22, 2012 8:50 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Drive MAX7219 with I2C with shell script
Replies: 31
Views: 11144

Re: Drive MAX7219 with I2C with shell script

if I use 8 x PCA9555 then i have 8x16 matrix?
If you wire them up in a grid then it will look like a matrix but it will not be a matrix because that involves multiplexing.
Will PCA9555 remember it's state
Yes it will carry on outputting the PWM value you last set it at.
by Grumpy Mike
Mon Oct 22, 2012 8:46 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Am I being stupid or is this possible?
Replies: 4
Views: 2142

Re: Am I being stupid or is this possible?

Is it possible to use wifi instead of Ethernet? Yes a USB WiFi dongle is an option. Would it be possible to take a pci graphics card and wire that into the Ethernet port No. surely it's wide enough and fast enough to handle some pretty cutting edge graphics comparable to a good pc Ethernet is 1 bit...
by Grumpy Mike
Sat Oct 20, 2012 7:13 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Drive MAX7219 with I2C with shell script
Replies: 31
Views: 11144

Re: Drive MAX7219 with I2C with shell script

Well a quick google search shows there is an I2C matrix driver the MAX6953
http://www.maximintegrated.com/datashee ... vp/id/3291
Not sure who stocks it though.
by Grumpy Mike
Sat Oct 20, 2012 7:07 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Input and Output using one GPIO pin
Replies: 32
Views: 17893

Re: Input and Output using one GPIO pin

pygmy_giant wrote:Is it true that Broadcom have a hanger containing a crashed alien spaceship?
Absolutely, I have seen it. ;)
by Grumpy Mike
Sat Oct 20, 2012 7:05 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Max number of 'lit' LEDs via MCP23017?
Replies: 5
Views: 3223

Re: Max number of 'lit' LEDs via MCP23017?

Maximum current out of VSS pin..150 mA
Maximum current into VDD pin 125 mA
So that means you can double the number of LEDs by having half of them powered by current sourcing and the other half by current sinking.
by Grumpy Mike
Sat Oct 20, 2012 7:03 pm
Forum: Python
Topic: Rpi.GPIO from multiple scripts simultaneously
Replies: 3
Views: 3477

Re: Rpi.GPIO from multiple scripts simultaneously

...so if both programs try to access the same I/O line what happens? Is it clever enough to let you know? Obviously if both programs can set and read an Input, it could be useful, but not if Outputs are involved. Texy That is why Rpi.GPIO has warnings. If you try and configure a GPIO pin as an outp...
by Grumpy Mike
Fri Oct 19, 2012 10:18 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Input and Output using one GPIO pin
Replies: 32
Views: 17893

Re: Input and Output using one GPIO pin

Another assumption is the value of the pull up resistor. Assumed is 10K but my guess would be that it is a lot higher. Some ware around 100K or so. Again this is an unknown spec. Pull up resistors minimum 50K maximum 65K Pull down resistors minimum 50K maximum 60K Why is this information not availa...
by Grumpy Mike
Fri Oct 19, 2012 10:10 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Max current and LEDs
Replies: 20
Views: 18151

Re: Max current and LEDs

I was surprised to see it has some marked as 0 ohms The main use is for engineers to arrange options on a circuit, especially on prototype boards. Zero ohm links as they are called are also available in surface mount and have been the life saver of many a project. We used to wind up the purchasing ...
by Grumpy Mike
Fri Oct 19, 2012 10:33 am
Forum: Python
Topic: Pulse timing with Python
Replies: 6
Views: 1813

Re: Pulse timing with Python

I should be able to average those measurements
I think better than averaging them would be to take several samples and discard the out laying samples. Or how about repeatedly taking samples and stopping when two successive samples are the same or within a few of each other.
by Grumpy Mike
Fri Oct 19, 2012 9:49 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Driving a (removed) laptop display using DSI
Replies: 8
Views: 3242

Re: Driving a (removed) laptop display using DSI

Well it never was a completely open system, no one ever pretended it was.
by Grumpy Mike
Fri Oct 19, 2012 8:24 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Drive MAX7219 with I2C with shell script
Replies: 31
Views: 11144

Re: Drive MAX7219 with I2C with shell script

The easiest way is a MAX7219, just talk to it with SPI like you are supposed to do. This is because it does the matrix refreshing for you. Otherwise you have to do it yourself in the code, this is what you have to do:- http://www.thebox.myzen.co.uk/Workshop/LED_Matrix.html The Pi is not suitable for...
by Grumpy Mike
Fri Oct 19, 2012 8:14 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Max current and LEDs
Replies: 20
Views: 18151

Re: Max current and LEDs

(Though I'm still not wrong :shock: ) Sorry yes you are still not wrong after a careful read of what you said. Just to add a little more sophistication to the calculations that are unique to the Pi. The output drive is normally used at the default value of 8mA. This gives a drive impedance of 31R, ...

Go to advanced search