I am trying to control my arduino (and connected servo) via Flash AS3. Controlling LEDs with PWM doesn't seem to be a problem but my servo is acting weird. I hooked up the servo at a PWM port and tried to control its position with a slider in Flash. The problem is that the servo moves almost randomly in every direction, and sometimes it has a delay. Also, it seems that the servo only reacts to my values when they are between 70 and 240 (between 180 and 240 it is working the best, but still quite random and not smooth at all).
Also controlling the servo by pure AS3 code (a counter that changes the PWM value) results in the same problem. Does anyone know what could be the cause? The servo works fine when using original Arduino software (standalone).
Can you tell me more about why this is a bad move? Most of the beginner tutorials say a pwm is good to control a servo (and using Arduino software for programming worked great with PWM ports).
I haven't heard of PPM before, can anybody help me how to set this up? Thanks for the answer!
Hmm ok that's clear. How can I do this with Arduino/Flash? I am now using the Glue 'program' to translate AS3 to Arduino but there is no PPM option or something like that.
Is that a code that uses PPM? The Sweep example on the page was the exact code I used when I programmed Arduino without using Flash. Now is my question, how do I use it within AS3?
Okay, but how can I use this in AS3? I assume I can't just use the attach() functions etc.
For example, a piece of AS3 where the pins are defined looks like this:
'digitalOut', // Pin 9 pwmOut or digitalIn or digitalOut
Since I can't set a pin to PPM I am wondering how to do this.
Does anybody know the Glue library for AS3 in Flash? I understand I need to use the Servo Library for Arduino, but how to control this by using Glue?
I hope someone can give me an answer
as3glue already has an ArduinoWithServo.as class (I believe it's included in the default download). You can learn about it on the as3glue Google code page Hope this helps.
Yeah I've managed to figure it out hey, I am using a neat little ui I designed in flash to control the transmitter of a toy rc car. I dont have the files here now, but I will upload a more detailed post when I have a moment.
No not at all, just incorporated them into my own code. Will try upload somthing this evening for you. I also found it quite tricky, are you using serpoxy or tinkerproxy and firmata...
I am using serproxy. Everything runs great, except I can't get my servo to have any precision. It jumps around, has deadspots between 0-30 and 180-255 when sending PWM signals. The servo also makes weird noises and gets hot if I dont unplug it once I send PWM signals.
I am using serproxy. Everything runs great, except I can't get my servo to have any precision. It jumps around, has deadspots between 0-30 and 180-255 when sending PWM signals. The servo also makes weird noises and gets hot if I dont unplug it once I send PWM signals.
Servos usually don't use PWM from an arduino, they use PPM generated from the servo library.