Go to advanced search

by billio
Tue Sep 09, 2014 10:46 pm
Forum: Python
Topic: Create a loop
Replies: 3
Views: 1608

Re: Create a loop

Here are a couple of suggestions. The "while" loop is OK but usually if you want to loop forever "while True" is the normal way of doing this. However, you may want to get out of this loop at some stage, especially when testing, so a "try .. finally ... " structure is a...
by billio
Mon Aug 18, 2014 7:50 pm
Forum: Python
Topic: problem in gpio setup
Replies: 3
Views: 983

Re: problem in gpio setup

You can find out which version of RPi.GPIO you are using by running your program with the -i option which ends in the Python command line, then , in your case, enter GPIO.VERSION . My version is 0.5.6 . But why not load the program into idle and then run it : sudo idle filename.py which has the adva...
by billio
Wed Jul 09, 2014 7:31 am
Forum: Python
Topic: using 2 serials
Replies: 10
Views: 2564

Re: using 2 serials

A simple quick way of testing is to insert some print statements into your code at strategic points to help identify what the program is doing.

Have you read this : http://stackoverflow.com/questions/2155 ... g-practice
by billio
Mon Jul 07, 2014 9:03 pm
Forum: Python
Topic: Retaining variables within functions
Replies: 27
Views: 4388

Re: Retaining variables within functions

Returning to your original code I would like to add some points that might be useful though they don't directly answer your question: a = [1,2,3,4,5,6] for i in a: # do something with i allows you do what you show in the code, and doesn't risk an error when the value of y moves beyond the length of ...
by billio
Fri Feb 28, 2014 7:23 pm
Forum: General discussion
Topic: Are ARM based computers the future?
Replies: 77
Views: 15133

Re: Are ARM based computers the future?

Apart from the technical difference between ARM and Intel, there is a significantly different business model. ARM = a design company, licensing intellectual property to the chip makers. Intel = an end-to-end design and manufacturing company. At the moment the ARM approach has driven it's phenomenal ...
by billio
Tue Oct 01, 2013 12:55 pm
Forum: Advanced users
Topic: Coder takes its power from Airport Extreme
Replies: 3
Views: 2196

Re: Coder takes its power from Airport Extreme

Just to add to this thread. I purchased a TP-Link Model TL-WR710B mini pocket router. When this is connected to the mains through the built-in plug and connected to the Raspberry Pi though a USB cable (for power) and an Ethernet LAN connector (small cable supplied), this provides access to the Pi th...
by billio
Fri Sep 20, 2013 2:36 pm
Forum: Advanced users
Topic: Coder takes its power from Airport Extreme
Replies: 3
Views: 2196

Re: Coder takes its power from Airport Extreme

OK. I have set-up access using smb, which works fine.

With regard to the power requirements affecting the Airport Extreme. The Pi is only powering the processor etc. and the ethernet port which I would have thought was well below 0.5 amps.
by billio
Fri Sep 20, 2013 10:35 am
Forum: Advanced users
Topic: Coder takes its power from Airport Extreme
Replies: 3
Views: 2196

Coder takes its power from Airport Extreme

I just realised that the USB port on an Airport Extreme lets me power a PI: run the power cable from the USB port. The Pi is running Coder (there is a short ethernet cable) so there is nothing else attached to the Pi thus the power requirement should be low. But I will see how it goes. This seems a ...
by billio
Sat Sep 14, 2013 12:54 pm
Forum: General discussion
Topic: Google Coder for Raspberry Pi
Replies: 2
Views: 795

Google Coder for Raspberry Pi

Which will be the best forum to discuss this initiative ?.

[http://googlecreativelab.github.io/coder/]

It looks extremely interesting.
by billio
Tue Aug 20, 2013 11:26 am
Forum: General discussion
Topic: external battery
Replies: 5
Views: 1064

Re: external battery

Ohm's Law applies, the Pi providing the resistance, the value of which depends on what the Pi and it's peripherals are doing at any one time.
by billio
Sun Jun 09, 2013 10:28 pm
Forum: Python
Topic: Control cursor with python
Replies: 3
Views: 5325

Re: Control cursor with python

I am not familiar with Windows, for Linux you will need to be more explicit about what you are trying to do.
Are you trying to move the mouse pointer in a window using the keys ?. Or is this on the command line ?. Or something else ?
by billio
Sun Jun 09, 2013 10:15 pm
Forum: Python
Topic: Python Question
Replies: 5
Views: 909

Re: Python Question

This is a difference between Python 2 and Python 3 : if you search the Python 3 documentation you will find : http://docs.python.org/3/library/functions.html#input will explain what happens in Python 3. But for Python 2.7 : http://docs.python.org/2/library/functions.html#input http://docs.python.org...
by billio
Fri Apr 26, 2013 7:53 pm
Forum: Troubleshooting
Topic: Start script pause for a minute after USB initialisation
Replies: 0
Views: 317

Start script pause for a minute after USB initialisation

When I power up the RPi the initialisation pauses for about one minute after recognising and initialising all the USB devices that are attached. Then, after the minutes pause, it carries on as normal eventually starting the desktop. My RPi didn't do this until a few days ago and this has not gone aw...
by billio
Fri Dec 21, 2012 10:21 am
Forum: Python
Topic: Error messages!
Replies: 3
Views: 3365

Re: Error messages!

To put the matter simply, a "positive" string doesn't make sense. When using "+ something", the + is a unary operator, i.e. it operates on only a single operand (the "something" bit). The error message is telling you that an operand of type str (that is, the type is a s...
by billio
Sat Nov 17, 2012 6:45 pm
Forum: Python
Topic: while loop - newbie question
Replies: 5
Views: 5306

Re: while loop - newbie question

If you think about it, to exit from the inner while loop "input_value" has to be true, so your second "if input_value" will always be False and the contents will not be executed. You can test this sort of thing in a crude way by inserting print statements into your code which sho...
by billio
Thu Nov 15, 2012 11:09 pm
Forum: Python
Topic: PYTHON NOOB ALERT.... Please Help Me.... PLEASE
Replies: 26
Views: 4776

Re: PYTHON NOOB ALERT.... Please Help Me.... PLEASE

It's just a different way of learning - see an answer, work out why it works, think why that answer wasn't obvious in the first place. This isn't necessarily better.
by billio
Thu Nov 15, 2012 9:15 pm
Forum: Python
Topic: PYTHON NOOB ALERT.... Please Help Me.... PLEASE
Replies: 26
Views: 4776

Re: PYTHON NOOB ALERT.... Please Help Me.... PLEASE

Try this (python 2.7) :

import random
mylist = ["red","white","blue","red"]
mylist = list(set(mylist))
random.shuffle(mylist)
for i in mylist : print i
by billio
Mon Oct 29, 2012 9:25 pm
Forum: General discussion
Topic: Acorn AFK60 monitor connected to Raspberry Pi
Replies: 1
Views: 612

Re: Acorn AFK60 monitor connected to Raspberry Pi

I have had some help on the RPi RiscOS forum and the RiscOpen Community forum. It works after a fashion and I will report any further updates on those forums.
by billio
Mon Oct 29, 2012 9:22 pm
Forum: RISCOS
Topic: Acorn AFK60 monitor
Replies: 5
Views: 1815

Re: Acorn AFK60 monitor

Thanks for your help, as suggested I used hdmi_safe=1 and I have it working after a fashion for both RiscOS and Raspbian. The display of the desktop is very small but I am fiddling with the config.txt file to try and improve matters.
by billio
Mon Oct 29, 2012 10:33 am
Forum: RISCOS
Topic: Acorn AFK60 monitor
Replies: 5
Views: 1815

Acorn AFK60 monitor

I asked this question in the Hardware forum, but I thought it might be useful to post it again here. Has anyone successfully connected an Acorn AFK60 monitor to a RPi. I thought it would be nice having the RPi working through the same monitor as a Risc PC. I am using the latest release of RiscOS. Th...
by billio
Mon Oct 29, 2012 9:56 am
Forum: General discussion
Topic: Acorn AFK60 monitor connected to Raspberry Pi
Replies: 1
Views: 612

Acorn AFK60 monitor connected to Raspberry Pi

Has anyone successfully connected an Acorn AFK60 monitor to a RPi. I thought it would be nice having the RPi working through the same monitor as a Risc PC. The monitor has a VGA input. I am using an HDMI to VGA connector (Cable Matters) from Amazon which many people state that should work with the R...
by billio
Tue Oct 23, 2012 10:15 pm
Forum: Python
Topic: When to declare variables as global
Replies: 27
Views: 8593

Re: When to declare variables as global

The reason for this behaviour being that the variable holding the reference to the list is not changed, it's still the same list even though the content of the list is changed ?.
by billio
Tue Oct 23, 2012 8:43 am
Forum: User groups and events
Topic: Anyone up for a Jam in Leeds?
Replies: 36
Views: 7081

Re: Anyone up for a Jam in Leeds?

Add me in (as long as I can catch the last bus from Leeds at 10pm).
by billio
Mon Oct 22, 2012 11:00 pm
Forum: Python
Topic: Help on editing script..
Replies: 12
Views: 2894

Re: Help on editing script..

The function is

lcd.message( string )

the string is being created by this string formatting

'IP %s' % ( ipaddr )

string formatting is covered in this tutorial :

http://docs.python.org/library/stdtypes ... formatting

the first example gives you a clue to what is going on here.
by billio
Mon Oct 22, 2012 10:44 pm
Forum: Python
Topic: Graphical user interface
Replies: 4
Views: 3568

Re: Graphical user interface

I would break your project into two parts. First, devising python code to provide some of the controls you want to implement, starting with a simple one. Running these controls interactively from the Python console provides a good starting point for testing. Second, pyqt is a good choice on which to...

Go to advanced search