Menü
Microbots
0
  • Machen
    • Erste Schritte
    • Maker-Builds
    • Ausbildung
  • Geschäft
    • ProtoBot
    • Maker-Module
    • Werkzeuge und Ausrüstung
    • Roboter & Displays
  • Um
    • Unsere Geschichte
    • Kontakt
    • FAQs
  • Einloggen
  • Deutsch
  • Ihr Warenkorb ist leer
Microbots
  • Machen
    • Erste Schritte
    • Maker-Builds
    • Ausbildung
  • Geschäft
    • ProtoBot
    • Maker-Module
    • Werkzeuge und Ausrüstung
    • Roboter & Displays
  • Um
    • Unsere Geschichte
    • Kontakt
    • FAQs
  • Sprache

  • 0 0

CodeCell: Richten Sie ein PWM in Sekunden ein

Pulsweitenmodulation (PWM) ist unerlässlich für die Steuerung der LED-Helligkeit, der Motordrehzahl und sogar der Erzeugung von Audiosignalen. Mit CodeCell ist die Einrichtung von PWM dank der Funktion pinPWM() kinderleicht. Im Gegensatz zu herkömmlicher Arduino-PWM, die vordefinierte Pins und zusätzliche Einstellungen erfordert, ermöglicht CodeCell die mühelose Aktivierung von PWM auf jedem der sechs verfügbaren Pins.

So verwenden Sie pinPWM()

Um ein PWM-Signal zu erzeugen, verwenden Sie:

 myCodeCell.pinPWM(uint8_t pin_num, uint16_t pin_freq, uint8_t pin_dutycycle);
  • pin_num → Der Pin, den Sie verwenden möchten (einer der 6 verfügbaren GPIOs von CodeCell).
  • pin_freq → Die Frequenz des PWM-Signals (in Hz).
  • pin_dutycycle → Der Arbeitszyklus (0–100), der den Prozentsatz der Zeit darstellt, in der das Signal HIGH bleibt.

Beispiel: Dimmen einer LED

Angenommen, Sie möchten eine an Pin 3 angeschlossene LED mit einer Frequenz von 1 kHz (1000 Hz) und 50 % Helligkeit dimmen:

 myCodeCell.pinPWM(3, 1000, 50);

So machen Sie die LED heller (z. B. 80 % Helligkeit):

 myCodeCell.pinPWM(3, 1000, 80);

Oder zum Ausschalten (0 % Helligkeit):

 myCodeCell.pinPWM(3, 1000, 0);

Warum diese Funktion verwenden?

  • Funktioniert auf allen 6 GPIOs von CodeCell – keine Einschränkungen.
  • Keine zusätzliche Einrichtung erforderlich – rufen Sie einfach pinPWM() auf und schon kann es losgehen.
  • Einstellbare Frequenz und Arbeitszyklus – perfekt für LEDs, Motoren und mehr.

Diese Funktion macht die PWM-Steuerung auf CodeCell flexibler und einfacher denn je. Probieren Sie sie in Ihrem nächsten Projekt aus!

  • Teilen:

Sozial

Github

  • Um
  • Software
  • Ausbildung
  • Kontakt
  • FAQs
  • Bedingungen
  • Rückerstattung-Politik
  • Datenschutzrichtlinie

Erfahren Sie als Erster von neuen Projekten und sichern Sie sich spannende Angebote!

© 2026 Microbots.

★ Reviews

Let customers speak for us

67 reviews
Write a review
85%
(57)
6%
(4)
1%
(1)
3%
(2)
4%
(3)
62
21
C
CodeCell C3
Cloke74

Great piece of kit, had just what i needed to complete the project i had in mind. Shame shipping to the UK is so expensive, but appreciate this isn’t necessarily in the hands of MicroBots

A
CodeCell C6
Anonymous

I had an issue, got a red light, I used too much flux. Support said clean it, then the one sensor worked fine. I got the help and answer same day I provided a foto.

A
CodeCell C6 Drive
Anonymous

I think this is the best of the ESP offered, most versatile.

User picture
P
CodeCell C6
Prudhvi tej Chinimilli

Been testing the Microbots CodeCell C6 and honestly impressed with how much functionality they packed into such a tiny module. Great form factor for rapid prototyping wearable/embedded sensing applications. ESP32-C6 + IMU integration makes development much easier compared to building everything from scratch.

Still exploring battery optimization and compact LiPo options for our use case, but overall the platform is promising for low-cost real-time sensing systems. Excited to keep building with it.

F
CodeCell C6
Francisco Estivallet

Amazing hardware, my go to for compact projects.

User picture
123