On 2014-05-13 14:41, andy pugh wrote:
> On 13 May 2014 13:09, Marius Liebenberg <mar...@mastercut.co.za> wrote:
>> Just a small word of warning here. I did the analog input thing with the
>> Arduino. There is code on the wiki that already works well. BUT!!!! the
>> usb route is not reliable for critical applications. Due to the fact
>> that the usb is not hot pluggable, it will disappear from the devices
>> list with any small hiccup or loss of connection.
> In that case the idea of using the analogue inputs to drive a
> frequency output into an encoder channel is probably more robust.
>
> it is nearly as simple as
>
> void setup(){
> pinMode(0, OUTPUT);
> }
>
> void loop(){
> float v;
> v = analogRead(0);
> tone(0,v); // Output the square-wave on pin 0 1024 HZ = 5V
> }

Yes and then just do a lowpass filter with a rc on the input of an opamp 
(voltage follower) to get a nice smooth dc voltage that is controlled by 
the PWM. Oh I just noticed you suggested a tone. In that case use a 555 
to do FTV (frequency to voltage) converter. Just as easy. Many circuits 
on Google.

-- 

Regards /Groete

Marius D. Liebenberg
+27 82 698 3251
+27 12 743 6064
QQ 1767394877


------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to