Show Posts
Pages: [1] 2 3 4
1  Using Arduino / Interfacing w/ Software on the Computer / Re: Servos do not work when controlled by Processing and Standard Firmata on: February 07, 2013, 05:13:13 pm
I can't help with Processing but I'm working with Python and Standard Firmata and I was controlling a Servo on Pin7 on Tuesday so its not a Standard Firmata issue.

Can you do simple things like turning Pins off and on?

Simon
2  Using Arduino / Interfacing w/ Software on the Computer / Re: Scratch talking to Arduino via Pyfirmata on: February 07, 2013, 11:43:35 am
Project is going quite well - I recently had 6 Arduino's in a class with age 10 pupils controlling stepper motor,servos, 7 seqment display, LEDs and a PIR Sensor.

They made a musical box twirlling ballerine with the stepper motor, stop/go flag with the servo, dice with the LEDs and 7 Segment display and a burglar alarm with the PIR Sensor smiley

1. Be able to control digitial outs (Done)
2. Accept Analog input (Removed at moment - too much data aat moment swamping serial comms)
3. Control PWM outs (Done)
4. Make an install.bat file for PC so it installs Python 2.7 together with pyserial, pyfirmata and my handler prog to make it easy to deploy for Scratchers (Got one that works on Windows)
5. Auto-find the Arduino port so it doesn't have to be manually configured (Done on Windows)
6.  Controls two 5 wire unipolar steppers (Done)
7.  Servo control (Done)

https://cymplecy.wordpress.com/2013/01/12/scratch-controlling-shrimparduino/

Simon
3  Using Arduino / Interfacing w/ Software on the Computer / Re: where is the standard firmata menu ? on: January 29, 2013, 06:55:43 pm
I'm not sure I fully understand your problem but I use Firmata  a lot so may be able to help


First of all upload Files-Example-Firmata-StandardFirmata to your Arduino

Is that seems to work OK then run the firmata test program.

What happens with you ?

regards

Simon
PS I use Windows XP
4  Using Arduino / Interfacing w/ Software on the Computer / Re: Scratch talking to Arduino via Pyfirmata on: January 18, 2013, 04:50:44 pm
Does 3 now (PWM)
and also can use pins as servo's as well smiley

Simon
5  Using Arduino / Interfacing w/ Software on the Computer / Scratch talking to Arduino via Pyfirmata on: January 17, 2013, 11:14:31 am
JFI - I'm trying to make generic and easier to modify system other than using S4A to control an Arduino.

I'm basically writing a python handler program that listens for Scratch broadcasts and variable changes and then relays them to an Arduino running Firmata.

I'm looking for alpha testers at the moment (one user reports it doesn't work on a Mac - I've tested it on XP PC and Win7 64bit PC)

Blog link here: http://cymplecy.wordpress.com/2013/01/12/scratch-controlling-shrimparduino/

Roadmap is to

1. Be able to control digitial outs (Done)
2. Accept Analog input (Done)
3. Control PWM outs (in progress)
4. Make an install.bat file for PC so it installs Python 2.7 together with pyserial, pyfirmata and my handler prog to make it easy to deploy for Scratchers (started)
5. Auto-find the Arduino port so it doesn't have to be manually configured (not started)

regards

Simon
6  Using Arduino / Interfacing w/ Software on the Computer / Re: Control Arduino from WIndows using Python on: November 18, 2012, 04:03:58 pm
Finally after many days of googling and trying I've manged to get a continous blink and read an analog input program running smiley
Code:
from pyfirmata import Arduino, util
import time
a = Arduino("COM2", baudrate=57600) # Baudrate must match rate set in sketch

print "wait"
time.sleep(2)
print "Go"
it = util.Iterator(a)
it.start()
a.analog[5].enable_reporting()
while True:
    a.digital[12].write(1)
    time.sleep(1)
    a.digital[12].write(0)
    time.sleep(1)
    print "analog 5" , a.analog[5].read()

I downloaded pyfirmata from here
https://bitbucket.org/tino/pyfirmata
and added to my python 2.7 install by cd ing to my download location
Code:
E:\downloads\tino-pyfirmata-4bed4280dd31\tino-pyfirmata-4bed4280dd31
and then typing
Code:
c:\Python27\python.exe setup.py install

regards
Simon
7  Using Arduino / Interfacing w/ Software on the Computer / Re: Control Arduino from WIndows using Python on: November 14, 2012, 05:25:58 pm
Not at all smiley
Over an hour the count should have got to 1800 smiley

Simon
8  General Category / General Discussion / Re: Proposal for workshopping with Python and Firmata on: November 14, 2012, 04:47:10 am
Disclaimer - I know Cefn (and have met Grumpy Mike  ).

I'm a primary school technican/HLTA and therefore the concept of learning a simple system before moving onto a "real world" system is the way it is with young children.

I learnt electronics from brick-type kits which I then threw away and built Heathkit type kits and I then I built a Linear Amp from scratch and then I went and had a career as a Transmitter Engineer.

So learning a "mickey-mouse" language is a great benefit at the beginning as it buffers the learner from the "real-world" and allows them to make progress.

I see the concept of first learning about programming an arduino via a higher level language on a PC before switching to its c-like structure as just part of the whole Lego/Mecanno learning concept smiley

regards
Simon
9  Using Arduino / Interfacing w/ Software on the Computer / Re: Control Arduino from WIndows using Python on: November 13, 2012, 06:28:07 pm
this is getting wierder !
I'd left the python prog running since last post and just noticed my LED on in 12 going off and on - switched to my Python console and the count is now up to 43!

Simon
10  Using Arduino / Interfacing w/ Software on the Computer / Re: Control Arduino from WIndows using Python on: November 13, 2012, 05:38:57 pm
made no diff - switched it down to com2 - still stopped after 5 iterations smiley-sad

Simon
11  Using Arduino / Interfacing w/ Software on the Computer / Re: Control Arduino from WIndows using Python on: November 13, 2012, 05:30:29 pm
"Ditch" might be the nice term to use over this side of the pond smiley

i don't think that the high com port num is the problem as the Firmate_Test.exe prog works just fine (unless Python on Windows can't handle it???)

(I'm running an 8 Yr old XP machine here that has had more USB kit plugged into it over the years that I've had hot dinners)

I did reset a com port to a lower number a few years ago  so might try doing it again.

regards
Simon
12  Using Arduino / Interfacing w/ Software on the Computer / Control Arduino from WIndows using Python on: November 13, 2012, 04:22:41 pm
1st post attempt failed so this one is not as long winded

This code
Code:
from firmata import *
import time
a = Arduino("COM32", baudrate=57600) # Baudrate must match rate set in sketch
#time.sleep(3)
a.pin_mode(12, firmata.OUTPUT)

print "wait"
time.sleep(2)
print "Go"
b=1
while True:
    a.digital_write(12, firmata.HIGH)
    time.sleep(1)
    a.digital_write(12, firmata.LOW)
    time.sleep(1)
    print "count" , b
    b= b +1

#a.serial.close()

Stops after 5 counts - ctrl-c takes tens secs to hand back control and then it give this
Code:
Traceback (most recent call last):
  File "E:\Dropbox\Private\arduino\py\firmatatest.py", line 12, in <module>
    a.digital_write(12, firmata.HIGH)
  File "build\bdist.win32\egg\firmata\firmata.py", line 91, in digital_write
    self.serial.write(chr(self.digital_output_data[port_number] >> 7))
  File "C:\Python27\lib\site-packages\serial\serialwin32.py", line 268, in write
    err = win32.GetOverlappedResult(self.hComPort, self._overlappedWrite, ctypes.byref(n), True)
KeyboardInterrupt

any ideas why and what to do about it or alternative working methods of switching pins off and on using Python from Windows?

regards
Simon
13  Using Arduino / Microcontrollers / Re: Why do a lot of people want to burn bootloaders into chips? on: September 10, 2011, 02:31:13 am
Quote
Just solder a .1 cap from the DTR hole pad to the base of the RST connector pin, turn the board over and cut the trace that was going to the RST pin, and you gain arduino auto-reset.

Just checking (as I'm a newbie) - are you saying one of these
http://www.ebay.com/itm/370532286388?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1439.l2649
plus quick modification and home-made pinout adaptor and you've got yourself a cheap FTDI setup to program chips with bootloader?

Simon
14  Using Arduino / Microcontrollers / Re: Why do a lot of people want to burn bootloaders into chips? on: September 09, 2011, 12:50:22 pm
Quote
I wanted to program the boot loader into it so that I can develop the new software directly on the hardware it will run on.

I can see if your developing like that and need to access the serial port for debugging info via FTDI connections then that's a very good reason.

Quote
but I prefer working in the Arduino IDE instead of in the gcc command line environment.

Who doesn't! ... but the only time a command line is needed is to set the fuses - after that its IDE all the way smiley  I'm thinking that what's needed is an option in the IDE to just set the fuses to the same settings as they would be if you'd burned the bootloader for your device.
But then, there would just be lots of posts asking how to burn the fuses so no real gain smiley
So I've probably got the answer to the question smiley

Simon






15  Using Arduino / Microcontrollers / Re: Help understanding ISP programming, bootloading, cores, USB to serial on: September 08, 2011, 04:14:28 pm
Link to example
http://www.ebay.co.uk/itm/USBASP-USBISP-AVR-Programmer-AVRDude-USB-Port-/180666590548?pt=UK_AudioElectronicsVideo_Video_TelevisionSetTopBoxes&hash=item2a10916554
Si
Pages: [1] 2 3 4