Go to advanced search

by tenochtitlanuk
Mon Feb 17, 2014 11:21 pm
Forum: Python
Topic: How to calculate moving average
Replies: 15
Views: 4646

Re: How to calculate moving average

Example, throwing a totally random input in range 0<-->100, so the running average should settle near 50... Note I use Python3, so 'print' uses brackets... import random, time runAve =0 while True: time.sleep(1) count =random.randrange( 0, 100) print ( count, runAve) runAve =9/10*runAve +1/10*count
by tenochtitlanuk
Mon Feb 17, 2014 11:13 pm
Forum: Python
Topic: How to calculate moving average
Replies: 15
Views: 4646

Re: How to calculate moving average

Simple way is to add 1/30 of the NEW value each time to 29/30 of the recorded current average. For elegance you could take the first say 10 values and average them, and then start the loop described. Of course such smoothing algorithms will adversely affect your ability to 'see' genuine sudden chang...
by tenochtitlanuk
Fri Feb 14, 2014 6:08 pm
Forum: Off topic discussion
Topic: Easy/Hard Programming Tasks
Replies: 18
Views: 2560

Re: Easy/Hard Programming Tasks

( +1) simplesi, learningsi, improvingsi, level1si, level2si,,,,,,,,,, gurusi I reckon you're well up that ladder, and many of us are grateful for your efforts and honesty in publishing problem situations... Yeah, we'd all love to get to guru without the pain. I had many years of the expectation of t...
by tenochtitlanuk
Wed Feb 12, 2014 3:26 pm
Forum: Other programming languages
Topic: A program that pulls info from a webpage
Replies: 12
Views: 8568

Re: A program that pulls info from a webpage

If you look on the http://rosettacode.org/wiki/Web_scraping#Python Rosetta Code pages you'll find a very short & neat Python example, using urllib.
by tenochtitlanuk
Wed Feb 12, 2014 9:51 am
Forum: General discussion
Topic: Half-life equation?
Replies: 4
Views: 1017

Re: Half-life equation?

If you store periodic table data in a database, the proton & neutron numbers could index into pre-filled data. Proton number alone identifies the element name and therefore the chemistry ( except for exotics like Technetium!) so could return to the user things like colour, physical properties such a...
by tenochtitlanuk
Mon Feb 10, 2014 9:51 am
Forum: Automation, sensing and robotics
Topic: Pi Based Tide clock/display
Replies: 16
Views: 5454

Re: Pi Based Tide clock/display

Agree entirely... it's these odd uses which are the most fun.
by tenochtitlanuk
Thu Feb 06, 2014 1:04 pm
Forum: General discussion
Topic: BBC Newsnight: Year of code (train wreck)
Replies: 50
Views: 9930

Re: BBC Newsnight: Year of code (train wreck)

I'd missed this. Thanks for the alert! What a squirm-making waste of my licence-paying money. I've played with computing machines since the Sixties, and as a teacher promoted them to staff & pupils. Had a great time in the early days- some pupils wanted to try Computing A Level so we did it in our o...
by tenochtitlanuk
Tue Feb 04, 2014 11:16 pm
Forum: Beginners
Topic: Using a LiPo battery pack
Replies: 15
Views: 7255

Re: Using a LiPo battery pack

I'm happily using series-pairs of ex-laptop LiPo cells. I feed their output to a 5V UBEC and this feeds the Pi by leads soldered to TP1 & 2. I charge the cells with a homebrew charger that current-limits at about 600mA, but the current is arranged to trail off to zero as the LiPos reach full voltage...
by tenochtitlanuk
Tue Feb 04, 2014 11:06 pm
Forum: Automation, sensing and robotics
Topic: Pi Based Tide clock/display
Replies: 16
Views: 5454

Re: Pi Based Tide clock/display

I see three areas of interest here worth using a Pi for. 1 If you have access to the sea, install a vertical pipe sump-and-float, and use a Pi to record a year's worth of tidal level. Now do a frequency/amplitude/phase analysis on it. 2 Use this data, or the appropriate constants scraped from the we...
by tenochtitlanuk
Sun Feb 02, 2014 7:39 pm
Forum: Automation, sensing and robotics
Topic: automatic garden beds
Replies: 8
Views: 1659

Re: automatic garden beds

Perhaps pulleys and counterweights ( or pre-loaded springs) at each end to greatly reduce the needed force??
That's how many up-and-over garage doors- often quite heavy- are often operated.
by tenochtitlanuk
Sat Feb 01, 2014 10:11 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Switching power: high side or low side?
Replies: 19
Views: 6108

Re: Switching power: high side or low side?

I regularly use a logic-level P channel en-MOSFET to do high-side switching, using an NPN junction transistor to pull the gate more than the 2V or so needed below positive rail as the input voltage move up. The graphic is a Spice simulation- it shows the load is connected as the input rises above 0....
by tenochtitlanuk
Fri Jan 31, 2014 6:49 pm
Forum: Beginners
Topic: Can the Raspberry Pi computer run Firefox?
Replies: 5
Views: 1207

Re: Can the Raspberry Pi computer run Firefox?

'IceWeasel is Firefox rebranded' if you want to give it a go.
by tenochtitlanuk
Thu Jan 30, 2014 12:02 pm
Forum: General discussion
Topic: External power on LED?
Replies: 11
Views: 4035

Re: External power on LED?

Just a reminder that the 'shutdown' state does not mean the Pi is no longer drawing current from the psu....
by tenochtitlanuk
Wed Jan 22, 2014 7:41 pm
Forum: Troubleshooting
Topic: sftp from Ubuntu to Pi problem
Replies: 6
Views: 1580

Re: sftp from Ubuntu to Pi problem

Started working correctly today after I restarted the Pi server and it got a new address from the router!
by tenochtitlanuk
Mon Jan 20, 2014 6:44 pm
Forum: Troubleshooting
Topic: sftp from Ubuntu to Pi problem
Replies: 6
Views: 1580

Re: sftp from Ubuntu to Pi problem

Seems something about Filezilla.
I can also successfully use

Code: Select all

sftp user@address
from the command line in Ubuntu.
by tenochtitlanuk
Mon Jan 20, 2014 6:28 pm
Forum: Troubleshooting
Topic: sftp from Ubuntu to Pi problem
Replies: 6
Views: 1580

Re: sftp from Ubuntu to Pi problem

JRV- that did indeed work! But FileZilla still announces 'ssh_init: invalid argument when supplied with the same address and login details...
Redhawk. Checked the ref'ce but it doesn't seem to be helpful in my case.
by tenochtitlanuk
Mon Jan 20, 2014 1:13 pm
Forum: Troubleshooting
Topic: sftp from Ubuntu to Pi problem
Replies: 6
Views: 1580

sftp from Ubuntu to Pi problem

Set up a Pi as a web-server. Runs fine. sftp'd in and created webpages from XP. No problem.
But when I sftp (Filezilla in both cases, with exactly the same settings!) from an Ubuntu machine on the same local network it errors- although Putty can ssh to it!
Any ideas? (no Ubuntu firewall running)
by tenochtitlanuk
Mon Jan 06, 2014 10:28 pm
Forum: Staffroom, classroom and projects
Topic: what use is mathematica for raspi
Replies: 23
Views: 9372

Re: what use is mathematica for raspi

The Raspberry Pi Foundation promotes education. It's brief is not age-specific, even if it targets mostly children in school. At age 67 I'm grateful to have my hands at last on a system that previously was financially beyond me but I long-time coveted. Many other Pi-owners are educating /extending t...
by tenochtitlanuk
Fri Jan 03, 2014 5:14 pm
Forum: General discussion
Topic: 80 thousand and counting
Replies: 53
Views: 9513

Re: 80 thousand and counting

Congratulations indeed to these contributors. I, like many, have learned a lot from these prolific posters. 80,000 does seem quite low. Perhaps the distributed Pi images should have raspberrypi.org/forum as a pre-installed 'Favourite' on the web browser- or even as home page? It's one of the first t...
by tenochtitlanuk
Tue Dec 31, 2013 10:08 am
Forum: Beginners
Topic: Convert 8gb image to 4gb
Replies: 8
Views: 3368

Re: Convert 8gb image to 4gb

I think you may have misunderstood the type of image being discussed here. It is the 'image file' which holds the entire contents of the Pi's boot, operating system, installed programs and data. If you mean processing image files in the sense of jpg, gif, png, bmp files, etc, do a search for 'ImageM...
by tenochtitlanuk
Sun Dec 22, 2013 3:47 pm
Forum: Camera board
Topic: Speed-sign reading.
Replies: 6
Views: 3651

Re: Speed-sign reading.

I can see some point in seeing local reduced speed limits during roadworks, but fear Pi speed will be the limit. Search forum for 'character recognition' or try sites like http://wiki.raspberrytorte.com/index.php?title=Optical_Character_Recognition EDIT it's a pain, but searching for 'ocr' gets all ...
by tenochtitlanuk
Fri Dec 20, 2013 9:34 pm
Forum: Automation, sensing and robotics
Topic: Stepper Motor - Simple use
Replies: 7
Views: 2965

Re: Stepper Motor - Simple use

On all floppy drives I've dismantled it's a bipolar stepper. The coils are typically ten ohms, so you need more current than a 9V battery can supply. I've just checked- one out of my parts box runs beautifully using an http://www.schmalzhaus.com/EBB/ EiBotBoard and a 12V mains-adaptor psu. Should wo...
by tenochtitlanuk
Fri Nov 22, 2013 8:57 pm
Forum: Automation, sensing and robotics
Topic: Reading a 7-segment display from controller
Replies: 15
Views: 5371

Re: Reading a 7-segment display from controller

You might be interested in the optical-character-recognition method. I've had some success with this- but you need specialised 7-seg OCR or write your own.. See http://www.raspberrypi.org/phpBB3/viewtopic.php?f=37&t=57727&p=434958 The Pi looking at the 7-seg display could easily ftp the result to a ...
by tenochtitlanuk
Wed Nov 13, 2013 10:39 am
Forum: Troubleshooting
Topic: USB device no longer works after attaching switch to power
Replies: 6
Views: 2361

Re: USB device no longer works after attaching switch to pow

Some USB cables have ridiculously thin cores for the four wires. At the 0.7A typical of a Pi they drop too much voltage. It's also possible a switch rated for such high currrent uses silver (which are not self-cleaning at low currents) rather than gold-flashed surfaces. Does it work if you short the...
by tenochtitlanuk
Sat Nov 09, 2013 10:57 am
Forum: Other projects
Topic: LED RGB Pixel Help.
Replies: 7
Views: 1655

Re: LED RGB Pixel Help.

Is your circuit diagram, as-shown, what you've actually wired up?
It shows the three LEDs paralleled, so you cannot independently drive them! Surely you should be showing three separate connections from the GPIO pins to the three LEDs, and a single, common, earth wire? Then use PWM on each pin.

Go to advanced search