Go to advanced search

by bulldog5046
Thu Dec 27, 2012 9:12 pm
Forum: Bare metal, Assembly language
Topic: Assembly function's/Servo Control
Replies: 6
Views: 1938

Re: Assembly function's/Servo Control

Amazingly, i've got this sort of working! slightly misleading but the Wait along with my LED flash was causing an unexpectedly long delay between the code. I removed the OK flashes and the servo is finally moving. I have another bug that i'm struggling with though if anyone has any thoughts. the ser...
by bulldog5046
Thu Dec 27, 2012 7:48 pm
Forum: Bare metal, Assembly language
Topic: Assembly function's/Servo Control
Replies: 6
Views: 1938

Re: Assembly function's/Servo Control

Thanks Joan, i've corrected that now to have a pulse width of 20000 and servo pulse between 500-2500. I've managed to improvise a method for debugging my code by flashing the OK LED after each line of code. It's certainly show up some odd problems. Firstly, my function called ServoPulse wasnt even r...
by bulldog5046
Thu Dec 27, 2012 5:47 pm
Forum: Bare metal, Assembly language
Topic: Assembly function's/Servo Control
Replies: 6
Views: 1938

Re: Assembly function's/Servo Control

Thanks Philippe, I've corrected those and i also discovered my timing was out and should of been 25000 pulse width. But i still cant quite get this working. Trying to work out my bug's has posed a question that i cant find an answer to though. When doing a subtraction does the original value remain?...
by bulldog5046
Sun Dec 23, 2012 6:20 pm
Forum: Bare metal, Assembly language
Topic: Assembly function's/Servo Control
Replies: 6
Views: 1938

Assembly function's/Servo Control

Hi guy's, I've been going though the Cambridge Uni tutorials today to grasp the idea's behind assembly and bare metal programming. It's not been going too badly but after completing the first set of tutorials i decided to set off and do my own thing which has invaribly gone wrong and i'm at a loss a...
by bulldog5046
Thu Dec 20, 2012 12:43 pm
Forum: Automation, sensing and robotics
Topic: Raspberry Pi Cat Poop Detector
Replies: 13
Views: 6882

Re: Raspberry Pi Cat Poop Detector

That's actually quite amusing, i could see it getting quite a following on twitter.

Can i make a suggestion? prehaps add a limiter to prevent multiple posts to twitter for the same instance. And, install an infrared light so the nighttime shots have something to see!
by bulldog5046
Wed Sep 05, 2012 2:54 pm
Forum: Python
Topic: RPi crashes after python script
Replies: 12
Views: 2939

Re: RPi crashes after python script

Are you printing alot of data to screen?

python crashes my Pi too if i print all of the servo updates to screen...
by bulldog5046
Tue Sep 04, 2012 8:23 pm
Forum: Python
Topic: Multitasking, how do i solve this one?
Replies: 32
Views: 4496

Re: Multitasking, how do i solve this one?

I do see your point.

Maybe I'm just being a bit savage in trying to make my code a lite as possible.

I'll try and keep it by the book but in these learning stages we tend to question 'why' alot :D

Ry
by bulldog5046
Tue Sep 04, 2012 6:58 pm
Forum: Python
Topic: Multitasking, how do i solve this one?
Replies: 32
Views: 4496

Re: Multitasking, how do i solve this one?

Cool,

Just interested, if you did it my old method when i ran 2x open.write and didn't close, does any close show up on strace?
by bulldog5046
Tue Sep 04, 2012 6:33 pm
Forum: Python
Topic: Morse machine problems...
Replies: 7
Views: 1296

Re: Morse machine problems...

I'm caveat my reply by letting you know i'm still learning myself, but something like this may work using your original code. I'm just unsure if you can use a variable to create the function name your calling on? def translate(self, reponse): count=0 word = len(response) when count <= word: letter =...
by bulldog5046
Tue Sep 04, 2012 12:34 pm
Forum: Python
Topic: Multitasking, how do i solve this one?
Replies: 32
Views: 4496

Re: Multitasking, how do i solve this one?

I've just given the 'with' statement a shot as below: with open(dvr,'w') as f: f.write('%d=%d\n'%(0,s1)) f.write('%d=%d\n'%(1,s2)) but it has the same effect as before. It accepts the first line and rejects the second. Seemingly because the driver has forced the file to closed?
by bulldog5046
Tue Sep 04, 2012 10:54 am
Forum: Python
Topic: Multitasking, how do i solve this one?
Replies: 32
Views: 4496

Re: Multitasking, how do i solve this one?

Hi Tim, I don't have a servo so can't test things, but a couple of points to note. 1. I see in your python code you are doing sb.close . This does not close the file handle. You need to do sb.close() 2. If the driver doesn't handle multiple writes, it may require a the device to be close() explicitl...
by bulldog5046
Tue Sep 04, 2012 7:02 am
Forum: Python
Topic: Multitasking, how do i solve this one?
Replies: 32
Views: 4496

Re: Multitasking, how do i solve this one?

but it wouldn't work because the driver would see one write of two commands. You'd have to make to two separate calls to echo, of one command each. Maybe I should fix that behaviour.. I think that makes sense doesn't it? to update 8 servo's with a single call rather than 8 seperate calls... :ugeek:
by bulldog5046
Mon Sep 03, 2012 7:41 pm
Forum: Python
Topic: Multitasking, how do i solve this one?
Replies: 32
Views: 4496

Re: Multitasking, how do i solve this one?

Thanks.

Just one last one, if you did this from shell:

Code: Select all

#echo 0=110\n1=110 > /dev/servoblaster
if that the correct syntax? servoblaster reply's that it is an invalid argument. Just wondering if the driver can't handle more than 1 line at a time?
by bulldog5046
Mon Sep 03, 2012 7:24 pm
Forum: Python
Topic: Multitasking, how do i solve this one?
Replies: 32
Views: 4496

Re: Multitasking, how do i solve this one?

Hi, I did actually test with 2 seperate write commands and i received the same error. I didnt use a loop though, although i don't see that it would make a difference if your example? I think python report sb.close() as the error as the file has already been closed by the driver, rather than being a ...
by bulldog5046
Mon Sep 03, 2012 6:34 pm
Forum: Python
Topic: Multitasking, how do i solve this one?
Replies: 32
Views: 4496

Re: Multitasking, how do i solve this one?

Right, here is my revised lightweight version. Could be lighter if i didnt need to make 2 calls to /dev/servoblaster as per my previous post. Does this look better guys? #!/usr/bin/python import time s1=50 s2=50 c1=2 c2=2 while 1==1: s1=s1+c1 if s1 >= 240 or s1 <= 50: c1=0-c1 s2=s2+c2 if s2 >= 240 o...
by bulldog5046
Mon Sep 03, 2012 6:30 pm
Forum: Python
Topic: Multitasking, how do i solve this one?
Replies: 32
Views: 4496

Re: Multitasking, how do i solve this one?

@BlackJack: Good point. In any case, there is no point updating the servo position more frequently than every 20ms, as the driver only sends a pulse every 20ms for a given servo. I'd expect that loop to run faster than 20ms, even with starting a shell twice each iteration. bulldog5046 is just learn...
by bulldog5046
Mon Sep 03, 2012 10:01 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Component Help - GPIO to servo's
Replies: 0
Views: 555

Component Help - GPIO to servo's

Hi guys, I'm just getting to grips with having my Pi control a couple of servo's and i'm looking to make an appropriate plug and play board for the GPIO header to sort the power & signal from a standard 3 pin servo connector. I know little about components and have no idea what i'm looking for on th...
by bulldog5046
Mon Sep 03, 2012 9:19 am
Forum: Python
Topic: Multitasking, how do i solve this one?
Replies: 32
Views: 4496

Re: Multitasking, how do i solve this one?

Thanks guys. I'm all ears for suggestions on how to do this better. I'm new to python but have PHP experience so i'm tending to use and look for methods from there. I guess rather then a opening a shell and echo'ing the statement i could be doing something like write file but i'm not sure how in pyt...
by bulldog5046
Sun Sep 02, 2012 6:33 pm
Forum: Automation, sensing and robotics
Topic: Driving multiple servos from the RaspberryPi
Replies: 209
Views: 92514

Re: Driving multiple servos from the RaspberryPi

For the benefit of anyone like me who may struggle with this, here is a brief laymans how-to from a fresh build: Install Git sudo apt-get install git Clone the servoblaster github git clone git://github.com/richardghirst/PiBits.git CD to the servoblaster dir cd PiBits/ServoBlaster Load the servoblas...
by bulldog5046
Sun Sep 02, 2012 6:19 pm
Forum: Python
Topic: Multitasking, how do i solve this one?
Replies: 32
Views: 4496

Re: Multitasking, how do i solve this one?

Yes, there were deffinately error's in my above code. It didnt work! :lol: Thanks for the advice, it's working spot on now 8-) #!/usr/bin/python import os import time servo1 = 50 servo2 = 50 servo1tick = +2 servo2tick = +2 while 1 == 1: if servo1tick == +2: servo1 = servo1 + 2 os.system("echo 1=" + ...
by bulldog5046
Sun Sep 02, 2012 5:56 pm
Forum: Python
Topic: Multitasking, how do i solve this one?
Replies: 32
Views: 4496

Multitasking, how do i solve this one?

I've written the below script to cycle 2 servo's back and forth. Now, as python reads line by line i've been unable to make the servo's cycle independantly but similatiously. How can i overcome this? This is my current version of code: #!/usr/bin/python import os import time servo1 = 50 servo2 = 50 ...
by bulldog5046
Sat Sep 01, 2012 3:23 pm
Forum: Automation, sensing and robotics
Topic: Driving multiple servos from the RaspberryPi
Replies: 209
Views: 92514

Re: Driving multiple servos from the RaspberryPi

Wehey! got it working :)

I created the 2 files but it dodnt creat /dev/servoblaster so i had to do it manually, then load the driver with 'sudo insmod servoblaster.ko' and i'm now able to successfully issue commands to the servo :)

Thanks,
by bulldog5046
Sat Sep 01, 2012 2:41 pm
Forum: Automation, sensing and robotics
Topic: Driving multiple servos from the RaspberryPi
Replies: 209
Views: 92514

Re: Driving multiple servos from the RaspberryPi

When you say 'use serverblaster.ko' how do you use it?

Just "sudo insmod servoblaster.ko"?
by bulldog5046
Fri Aug 31, 2012 6:01 pm
Forum: Automation, sensing and robotics
Topic: Driving multiple servos from the RaspberryPi
Replies: 209
Views: 92514

Re: Driving multiple servos from the RaspberryPi

As it's friday night and my plan's have been cancelled and the XBMC image on my SD card has gone up it's self i thought i'd take a look at this. Unfortunately it seems the Makefile doesnt work with the latest 18-08-2012 raspbian image? make: Nothing to be done for `all'. Also, i'm slightly confused ...
by bulldog5046
Fri Aug 31, 2012 1:03 pm
Forum: Automation, sensing and robotics
Topic: Driving multiple servos from the RaspberryPi
Replies: 209
Views: 92514

Re: Driving multiple servos from the RaspberryPi

Thank you for the details. This could prove very useful for a project i had in mind.

Just wish i had enough free time to play!

Go to advanced search