WOLFRAM SYSTEM MODELER

DimmingLed

Changing the intensity of an LED

Diagram

Wolfram Language

In[1]:=
SystemModel["ModelPlug.Examples.DimmingLed"]
Out[1]:=

Information

Hardware Components Used

  • 1 Arduino board
  • 1 LED
  • 1 resistor 680 ohms

Description

This example uses the AnalogOutput component to change the light intensity of an LED. AnalogOutput uses the Arduino function 'analogWrite', which produces a PWM (Pulse-Width Modulated) signal. This type of signal can be used to directly control the LED intensity. The following figure shows the connections.

For more information on the PWM outputs, the Arduino Playground is a good resource.

Components (3)

arduino

Type: Arduino

Description: Component with default configuration for Arduino boards

analogOutput

Type: AnalogOutput

Description: Writes an analog signal to the specified pin

sine

Type: Sine

Description: Generate sine signal