NerdKits - electronics education for a digital generation

You are not logged in. [log in]

NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.

Project Help and Ideas » Help with Strain gauge project

August 25, 2010
by animox
animox's Avatar

Hi Guys

I've bought the kit, played about will compiling programs to the MCU and all seems fine. Thought I'd have a go a the strain gauge project. Strain gauges and nerd kit wise I think I have it sussed, but on the computer/python side of things I'm getting to the end of my tether.

Managed to install and confirm installation of Python 2.6 but can not seem to run any of the nerd download programs i.e. live scale graph and live can counter.

I noticed the programs need to import objects like import threading import time import serial import sys import pygame

Any help on where to get these and where they need to be installed etc would be great. Alos does the py program need to be adjusted to point to my com3/usb serial?

August 27, 2010
by Ralphxyz
Ralphxyz's Avatar

Well I know next to nothing about python but I am also trying to get the weighscale project working.

I am getting really stupid things happening. When viewing the output to Terminal screen on my mini Mac, I am getting a stream of numbers that does change when I apply weight but the numbers continue (without any weight applied) even after I power off the MCU and amplifier.

As far as adjusting the com3/usb serial setting, yes you have to match what ya got.

For me I have s = serial.Serial("/dev/cu.PL2303-0000101D", 115200). Now I only assume this to be correct, it is logical but I have no way of knowing if my assumption is correct. This is in weighscale_pc-weighScale.py.

I can not run weighscale_pc-weighScale.py because of a missing serial module on my mac, anybody know how to setup python on a mac?

Ralph

August 29, 2010
by animox
animox's Avatar

Cheers Ralph

I know nothing about macs, but did change the dev/ line to com3 in my case. I got my serial extention for Python here if it helps http://sourceforge.net/projects/pyserial/files/

I now have the Python side of things running so hopefully I can put the two together soon

Alan

August 29, 2010
by Ralphxyz
Ralphxyz's Avatar

Right from the start Python is confusing there are two "Official Latest Release Versions" Python 2.7 and Python 3.1.2.

How a new user without a coach (friend) is supposed to know which "Version" to use has to be trial and error and a waste of time.

The short answer appears to be that Python 2.7 is "supported" by more peripherals (modules) so one should use 2.7 until you learn what the heck you are doing. Seems there used to be a big software company who would do things like this with their releases maybe the Python guys used to work for them. You also need wxputhon and pyGame besides pySerial.

I really did not want to learn another programming language but in order to use the weighscale project code I have to.

Ralph

August 29, 2010
by Ralphxyz
Ralphxyz's Avatar

And you also need numpy the Numerical Pyton module!

This is just for anyone in the future trying to install Python.

Ralph

August 30, 2010
by animox
animox's Avatar

I actually used all of the above modules and numpy, but with Python 2.6, only because one of the modules I found was specifing 2.6, but I'm sure it will work 2.7

Alan

August 30, 2010
by Ralphxyz
Ralphxyz's Avatar

I tried 3.1.2 on my mac but that failed to find the modules.

I was able to finally get 2.7 running in XP with all of the modules.

Ralph

September 01, 2010
by Ralphxyz
Ralphxyz's Avatar

Now it turns out that pygame will not run on 2.7 and I have to back rev to 2.5.4 which of course the other modules probable will not support. Is anyone running python on XP SP2. What modules are you running and what versions of the modules and python?

In order to run the weighscale pyython packages you need the following modules:

numpy
pyserial
pygame
wxputhon

Apparently there is a 2.5 and 2.6 version of pygame.

This is really stupid.

Ralph

September 02, 2010
by animox
animox's Avatar

I'm running XP sp3 with

python-2.6.6.msi,

pygame-1.9.1.win32-py2.6.msi,

pyserial-2.5.win32.exe,

wxPython2.8-win32-unicode-2.8.11.0-py26.exe,

numpy-1.5.0rc1-win32-superpack-python2.6.exe,

Hope this helps

Alan

Post a Reply

Please log in to post a reply.

Did you know that essentially all power supplies' voltages drop when current is drawn from them? Learn more...