Reader small image

You're reading from  C Programming for Arduino

Product typeBook
Published inMay 2013
Reading LevelIntermediate
PublisherPackt
ISBN-139781849517584
Edition1st Edition
Languages
Tools
Right arrow
Author (1)
Julien Bayle
Julien Bayle
author image
Julien Bayle

Julien Bayle owns his Master Degree of biology & computer sciences in 2000. After several years in pure IT System Design, he founded Design the Media early 2010 in order to provide his own courses, training & tools for art fields. As a digital artist, he designed some huge new media art installations, like the permanent exhibition of La Maison des Cinématographies de la Méditerranée (Château de la Buzine) in Marseille, France, in 2011. He also works as a new media technology consultant for some private & public entities. As an A/V live performer, he plays his cold electronic music from New York to Marseille, where he actually lives. Arduino framework is one of his first electronic hardware studies early 2005 and he designed the famous protodeck controller with some opensource framework too. As an art & technology teacher, also certified by Ableton in 2010, he teaches a lot of courses about the digital audio workstation named Ableton Live, about the real-time graphical programming framework Max6 and also about Processing and Arduino. As a minimalist digital artist, he works at the crossroads of sound, visual and data. He explores relationships between sounds and visuals through his immersive A/V installations, his live performances and his released music. His work, often described as “complex, intrigating and relevant”, tries to break classical codes to bring audience a new vision of our world through his pure digital and real-time generated stimuli. He's deeply involved in the open source community and loves to share and provide workshops and masterclasses online and on-site too. His personal website is http://julienbayle.net.
Read more about Julien Bayle

Right arrow

Simulating analog outputs with PWM


As we know very well by now, it's okay to switch on/off LEDs, and as we are going to see in the next chapter, to switch on/off many things too by using digital pins as output on the Arduino.

We also know how to read states from digital pins set up as inputs, and even values from 0 to 1023 from the analog inputs from in the ADC.

As far as we know, there isn't analog output on the Arduino.

What would an analog output add? It would provide a way to write values other than only 0 and 1, I mean 0 V and 5 V. This would be nice but would require an expensive DAC.

Indeed, there isn't a DAC on Arduino boards.

The pulse-width modulation concept

The pulse-width modulation is a very common technique used to mimic analog output behavior.

Let's put that another way.

Our digital outputs can only be at 0 V or 5 V. But at a particular time-interval, if we switch them on/off quickly, then we can calculate a mean value depending on the time passed at 0 V or 5 V. This mean can easily...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
C Programming for Arduino
Published in: May 2013Publisher: PacktISBN-13: 9781849517584

Author (1)

author image
Julien Bayle

Julien Bayle owns his Master Degree of biology & computer sciences in 2000. After several years in pure IT System Design, he founded Design the Media early 2010 in order to provide his own courses, training & tools for art fields. As a digital artist, he designed some huge new media art installations, like the permanent exhibition of La Maison des Cinématographies de la Méditerranée (Château de la Buzine) in Marseille, France, in 2011. He also works as a new media technology consultant for some private & public entities. As an A/V live performer, he plays his cold electronic music from New York to Marseille, where he actually lives. Arduino framework is one of his first electronic hardware studies early 2005 and he designed the famous protodeck controller with some opensource framework too. As an art & technology teacher, also certified by Ableton in 2010, he teaches a lot of courses about the digital audio workstation named Ableton Live, about the real-time graphical programming framework Max6 and also about Processing and Arduino. As a minimalist digital artist, he works at the crossroads of sound, visual and data. He explores relationships between sounds and visuals through his immersive A/V installations, his live performances and his released music. His work, often described as “complex, intrigating and relevant”, tries to break classical codes to bring audience a new vision of our world through his pure digital and real-time generated stimuli. He's deeply involved in the open source community and loves to share and provide workshops and masterclasses online and on-site too. His personal website is http://julienbayle.net.
Read more about Julien Bayle