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
Revision:
1:94375ff2c902
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/makefile	Sun Aug 16 14:27:12 2015 +0200
@@ -0,0 +1,18 @@
+# Copyright 2015 Adam Green (http://mbed.org/users/AdamGreen/)
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+PROJECT         := PwmOut
+NO_FLOAT_SCANF  := 1
+NO_FLOAT_PRINTF := 1
+
+include $(GCC4MBED_DIR)/build/gcc4mbed.mk