Go to advanced search

by tonygo2
Fri Mar 30, 2018 11:57 am
Forum: Python
Topic: Pygame KEYDOWN event crashes
Replies: 0
Views: 281

Pygame KEYDOWN event crashes

My pygame script keeps crashing without an error message after about 20 key presses. I cannot work out what is wrong and some ideas would be useful. This project uses UP, DOWN, LEFT and RIGHT to set LED RGB vales for a Blinkt strip and displays graphically the values on a tiny SSD1306 I2C display. R...
by tonygo2
Mon Mar 12, 2018 11:05 am
Forum: Astro Pi
Topic: Temperature Value Shown on LEDs
Replies: 19
Views: 19296

Re: Temperature Value Shown on LEDs

Getting code to display correctly in a post.

Paste the code into the editor. Make space above and below. Select the code and then click on "Code" in the menu.

Hope this also helps
by tonygo2
Mon Mar 12, 2018 10:58 am
Forum: Astro Pi
Topic: Temperature Value Shown on LEDs
Replies: 19
Views: 19296

Re: Temperature Value Shown on LEDs

This is how I got the SenseHAT joystick working. I hope this helps # Modified from Astro Pi Guide for Teachers # raspberrypi.org/resources # Tony Goodhew 26 Sept 2015 import pygame from pygame.locals import * from sense_hat import SenseHat pygame.init() pygame.display.set_mode((90,5))#Big enough sen...
by tonygo2
Thu Oct 20, 2016 10:15 am
Forum: Python
Topic: arduino communication help
Replies: 4
Views: 1051

Re: arduino communication help

Ok, you want to use a Pi but can only write code in Arduino IDE. Have a look at this - RasPiO® Duino. It is an Arduino clone that sits on top of the Pi and is programmed in the way you want to work. There is an excellent, easy to follow and full documentation from the producer. I suggest you visit A...
by tonygo2
Tue Oct 18, 2016 4:24 pm
Forum: Python
Topic: arduino communication help
Replies: 4
Views: 1051

Re: arduino communication help

Can I suggest that you use NANPY. You use the USB port and write your python code in almost Arduino C.
Search for NANPY in this forum. If you want some help sheets and the necessary files then send me a message and give me your email address and I will forwards the necessary files.
by tonygo2
Tue Oct 18, 2016 12:52 pm
Forum: Python
Topic: DIY flotilla-python documentation
Replies: 1
Views: 652

Matrix & Joystick

This second contribution uses the Joystick and Matrix modules. I used them orientated with the rope at the top of the modules. The joystick consists of two potentiometers , like the Dial module, crossed at the centre. A push-button switch is also included and activated by pushing down in the centre ...
by tonygo2
Tue Oct 18, 2016 10:56 am
Forum: Python
Topic: DIY flotilla-python documentation
Replies: 1
Views: 652

DIY flotilla-python documentation

I’m a bit ‘old-school’ as I started teaching computer programming, or coding, in 1968 and I like DOCUMENTATION. I do not want to guess or try this to see if it will work if the guy I bought a device from hasn’t told me how to use it properly. I know that developing software takes time but documentin...
by tonygo2
Sun Oct 18, 2015 2:16 pm
Forum: Astro Pi
Topic: Sense HAT now in commercial release
Replies: 40
Views: 12768

Re: Sense HAT now in commercial release

I've got mine in but it was quite a fiddle. You only need the two support posts on the long side near the joystick. The other long side is well supported by the GPIO pins. Leave out the bottom screws - they just get in the way of seating the Pi properly in the base. Leave out the SD card and white s...
by tonygo2
Sun Sep 27, 2015 6:24 pm
Forum: Astro Pi
Topic: Temperature Value Shown on LEDs
Replies: 19
Views: 19296

Re: Temperature Value Shown on LEDs

Here is a different way to show temperatures or humidity. The latter works better in a demo as it is easier to get the values to change quite quickly over a greater range if you 'huff' on it and then let it return to normal. Please remember that these sensors are not very accurate - ignore the decim...
by tonygo2
Sun Sep 27, 2015 10:39 am
Forum: Astro Pi
Topic: Missing modules when running test progra
Replies: 2
Views: 843

Re: Missing modules when running test progra

Did pillow install properly?
Did you do

sudo apt-get install python3-pip

Before
sudo pip-3.2 install pillow

Were there any error messages during the installation ?
by tonygo2
Sun Sep 27, 2015 10:26 am
Forum: Astro Pi
Topic: Missing modules when running test progra
Replies: 2
Views: 843

Re: Missing modules when running test progra

Look at https://www.raspberrypi.org/forums/viewtopic.php?f=104&t=119430 I think you also need to install pillow with sudo pip-3.2 install pillow The joystick instructions also need an update See https://www.raspberrypi.org/forums/viewtopic.php?f=104&t=121669 Best of luck. It’s a great piece of kit o...
by tonygo2
Sat Sep 26, 2015 9:33 am
Forum: Astro Pi
Topic: Joystick control
Replies: 1
Views: 1438

Joystick control

I could not get the joystick example in https://www.raspberrypi.org/learning/astro-pi-guide/inputs-outputs/joystick.md to work. It crashed at if event.key == K_DOWN and y < 7: with the following error: AttributeError: ‘Event’ object has no attribute ‘key’ I’ve not used pygame before, only the GPIO p...
by tonygo2
Wed Sep 23, 2015 7:59 am
Forum: Astro Pi
Topic: Build a new font ?
Replies: 5
Views: 1702

Re: Build a new font ?

That sounds like a REAL project! Best of luck.
by tonygo2
Tue Sep 22, 2015 7:11 pm
Forum: Astro Pi
Topic: Build a new font ?
Replies: 5
Views: 1702

Re: Build a new font ?

I've been doing something like that today. I wanted to display numbers in the ranges -100 to 100, 0 to 360 and time in hours and minutes. I used small digits (5x3 pixels) as you can get two of then side by side with a gap. I represented 100 with a capital T, for Ton = 100, like divers use to indicat...
by tonygo2
Sun Sep 20, 2015 2:46 pm
Forum: Astro Pi
Topic: Which way is Pitch and Roll
Replies: 9
Views: 2515

Re: Which way is Pitch and Roll

In the explanation at: https://www.raspberrypi.org/learning/astro-pi-guide/sensors/movement.md sudo apt-get install python3-pip sudo pip-3.2 install pi3d git clone git://github.com/astro-pi/apollo-soyuz cd apollo-soyuz sudo ./soyuz.py The last line did not work. It’s a Python3 program not C. “sudo p...
by tonygo2
Sun Aug 30, 2015 4:57 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Using an Arduino as a slave I/O board
Replies: 147
Views: 135889

Re: Using an Arduino as a slave I/O board

I'm still using version 0.8 and it does all I want. I have all the necessary files, some of which are no longer on the Internet. IM me and I will send you the files tomorrow.
by tonygo2
Fri Aug 28, 2015 5:59 pm
Forum: Astro Pi
Topic: Sense HAT now in commercial release
Replies: 40
Views: 12768

Re: Sense HAT now in commercial release

Compass.py, in the examples, tells you to calibrate the magnetometer with RTIMULibCal.
Has it been included in setting up the Sense HAT?
If so where is it?
If not could somebody please explain how to install it and use it?
I've now got my Sense HAT and it is working beautifully - very bright!
by tonygo2
Thu Aug 27, 2015 8:54 am
Forum: Astro Pi
Topic: Sense HAT now in commercial release
Replies: 40
Views: 12768

Re: Sense HAT now in commercial release

Wow!
Thank you all.
I'm sure I will soon get going once the device arrives and these links will help others.
by tonygo2
Thu Aug 27, 2015 8:00 am
Forum: Astro Pi
Topic: Sense HAT now in commercial release
Replies: 40
Views: 12768

Re: Sense HAT now in commercial release

Thanks for that information.
This looks to be a good bit harder than the simple push buttons with pull-ups on the Astro Pi going to the ISS. I am sure that a bit of code would be a great help to many of us.
by tonygo2
Wed Aug 26, 2015 5:53 pm
Forum: Astro Pi
Topic: Sense HAT now in commercial release
Replies: 40
Views: 12768

Re: Sense HAT now in commercial release

I've ordered one and read through the documentation for the API. Looks easy to access.
Still need to know which pins are used for the joystick? Help, please.
by tonygo2
Thu Feb 19, 2015 9:39 am
Forum: Python
Topic: LIRC with Python
Replies: 5
Views: 2083

Re: LIRC with Python

I want to react to a zapper button being pressed while running a Python program not just start a new one. The already running Python program needs to pick up a value and react to it. For example, I can drive an Arduino robot around the floor with zapper clicks to indicate FORWARDS, BACKWARDS, TURNRI...
by tonygo2
Tue Feb 17, 2015 4:17 pm
Forum: Python
Topic: LIRC with Python
Replies: 5
Views: 2083

LIRC with Python

I've been trying to use an IR receiver with a hobby zapper as input in a Python program but have hit a brick wall. I've got to the stage that typing "irw" at the prompt identifies correctly each button pressed on the screen - with a few extra random characters at the start of each line. At this poin...
by tonygo2
Sat Feb 14, 2015 4:29 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Using an Arduino as a slave I/O board
Replies: 147
Views: 135889

Re: Using an Arduino as a slave I/O board

by richrarobi » 14 Feb 2015 00:05 OK, I am converted! I prefer nanpy!! (Using 0.9.2 too!) Took all day (and all evening to make the code work!!!!) How did you get 0.9.2 to work? Can you add a SIMPLE guide to the last bit after downloading the git to uploading to the Arduino? I thought the Rx and Tx...
by tonygo2
Tue Feb 10, 2015 2:59 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: STICKY: Optional interfaces (I2C, I2S, SPI) and Device Tree
Replies: 128
Views: 140536

Re: Optional interfaces (I2C, I2S, SPI) and Device Tree

Wow! - what a quick reply.
Thank you very much. The first, and shorter one, worked perfectly.
One other point: can I use gpio pin #21 instead of #4? The tutorial I used specified #4 so I used that but #21 would be more useful.

Go to advanced search