Pulsweitenmodulation

Dependencies:   mbed

PwmOut

Pulsweitenmodulation (kurz PWM), ist eine Modulationsart, bei der die elektrische Spannung zwischen Ground (0 Volt) und 3.3 Volt wechselt.

Die relative Länge des Pulses wird Tastgrad (englisch duty cycle) genannt.

Der Abstand zwischen dem Startpunkt zwei aufeinnanderfolgender Pulse wird "Periode" genannt.

PwmOut kann nur mit Pins verwendet werden, welche mit PWM bezeichnet sind.

Das nachfolgende Programm erhöht die Helligkeit der LED an Pin D13.

Anwendungen

  • Licht dimmen
  • Motoren Geschwindigkeit regeln
Committer:
marcel1691
Date:
Sun Aug 16 14:27:12 2015 +0200
Revision:
1:94375ff2c902
Erweitert um Eclipse/gcc4mbed Konfiguration

Who changed what in which revision?

UserRevisionLine numberNew contents of line
marcel1691 1:94375ff2c902 1 # Copyright 2015 Adam Green (http://mbed.org/users/AdamGreen/)
marcel1691 1:94375ff2c902 2 #
marcel1691 1:94375ff2c902 3 # Licensed under the Apache License, Version 2.0 (the "License");
marcel1691 1:94375ff2c902 4 # you may not use this file except in compliance with the License.
marcel1691 1:94375ff2c902 5 # You may obtain a copy of the License at
marcel1691 1:94375ff2c902 6 #
marcel1691 1:94375ff2c902 7 # http://www.apache.org/licenses/LICENSE-2.0
marcel1691 1:94375ff2c902 8 #
marcel1691 1:94375ff2c902 9 # Unless required by applicable law or agreed to in writing, software
marcel1691 1:94375ff2c902 10 # distributed under the License is distributed on an "AS IS" BASIS,
marcel1691 1:94375ff2c902 11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
marcel1691 1:94375ff2c902 12 # See the License for the specific language governing permissions and
marcel1691 1:94375ff2c902 13 # limitations under the License.
marcel1691 1:94375ff2c902 14 PROJECT := PwmOut
marcel1691 1:94375ff2c902 15 NO_FLOAT_SCANF := 1
marcel1691 1:94375ff2c902 16 NO_FLOAT_PRINTF := 1
marcel1691 1:94375ff2c902 17
marcel1691 1:94375ff2c902 18 include $(GCC4MBED_DIR)/build/gcc4mbed.mk