Menu
Microbots
0
  • Apprendre
  • Boutique
    • Modules et technologies
    • Maker-Packs
    • Outils et engrenages
    • Robots & Displays
    • Tous les produits
  • Communauté
    • Education
    • Software
  • À propos
    • Notre histoire
    • Tendez la main
    • FAQ
  • français
  • Votre panier est vide
Microbots
  • Apprendre
  • Boutique
    • Modules et technologies
    • Maker-Packs
    • Outils et engrenages
    • Robots & Displays
    • Tous les produits
  • Communauté
    • Education
    • Software
  • À propos
    • Notre histoire
    • Tendez la main
    • FAQ
  • Langue

  • 0 0

CodeCell: Set Up a GPIO in Seconds

The CodeCell module makes working with GPIO (Input/Output) pins simpler than ever. While you can still use the traditional Arduino digitalWrite() and digitalRead() functions, CodeCell library uses the pinWrite() and pinRead(), which automatically handle pin initialization for you.

No Pin Initialization

With CodeCell's optimized functions, you don’t need to manually set the pin mode using pinMode(). Just call:

myCodeCell.pinWrite(uint8_t pin_num, bool pin_value);

For example, to turn on an LED connected to pin 5:

myCodeCell.pinWrite(5, HIGH);

Or turn it off:

myCodeCell.pinWrite(5, LOW);

Reading GPIO States

Reading a pin state is just as simple:

if (myCodeCell.pinRead(5)) {
    // Pin is HIGH, do something
}

The pinRead() function returns a boolean (true for HIGH, false for LOW), making GPIO interactions effortless.

Why Use These Functions?

  • No need for pinMode()—it’s handled automatically, making your sketches cleaner.

  • Built-in error detection—if a pin is not available on your CodeCell module, it will issue an error on the Serial Monitor, helping you debug the problem.

These functions make CodeCell's GPIO management more intuitive—whether you're controlling LEDs, buttons, and more!

 

  • Partager:


Voir l'article entier

Linking Your CodeCell to the MicroLink App
Linking Your CodeCell to the MicroLink App

Voir l'article entier

Debugging CodeCell
Debugging CodeCell

Voir l'article entier

CodeCell: Connecting with BLE
CodeCell: Connecting with BLE

Voir l'article entier

Partage

Github

  • À propos
  • Software
  • Education
  • Contact
  • FAQ
  • Termes
  • Politique de remboursement
  • politique de confidentialité

Soyez le premier informé des nouveaux projets et bénéficiez d'offres intéressantes !

© 2025 Microbots.