WOLFRAM SYSTEMMODELER

UsingStandardFirmata

Blinking a LED using a standard Firmata board

Diagram

Wolfram Language

In[1]:=
Click for copyable input
SystemModel["ModelPlug.Examples.UsingStandardFirmata"]
Out[1]:=

Information

Hardware Components Used

  • Any board with standard Firmata (this example uses the Teensy board)
  • 1 LED (optional)
  • 1 resistor 680 ohms (optional)

Description

This example uses the DigitalOutput component to control the built-in LED a standard Firmata board (this pin is controlled using pin 13). It uses a BooleanPulse component from the Modelica Standard Library to produce an On/Off signal that is fed into the DigitalOutput component. This will make the LED blink.

If you would like to add an external LED, you can connect it to the board as shown in the figure below and and add one more DigitalOutput component in the model to control the LED.

Components (3)

standardFirmata

Type: StandardFirmata

digitalOutput

Type: DigitalOutput

booleanPulse

Type: BooleanPulse