Menu
Microbots
0
  • Make
    • Getting Started
    • Maker Builds
    • Education
  • Shop
    • Maker-Modules
    • Maker-Packs
    • Tools & Gears
    • Robots & Displays
  • About
    • Our Story
    • Reach Out
    • FAQs
  • English
  • Your Cart is Empty
Microbots
  • Make
    • Getting Started
    • Maker Builds
    • Education
  • Shop
    • Maker-Modules
    • Maker-Packs
    • Tools & Gears
    • Robots & Displays
  • About
    • Our Story
    • Reach Out
    • FAQs
  • Language

  • 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!

 

  • Share:

Follow

Github

  • About
  • Software
  • Education
  • Contact
  • FAQs
  • Terms
  • Refund Policy
  • Privacy Policy

Join our Community ~ Be the first to know about new products and get exciting deals!

© 2025 Microbots.