🔌 In/Out – Your Digital “Senses and Limbs”

What it is: The blocks that allow the robot to receive information (input) and give commands (output).

What it does: Connects the physical world with your code.

Example: A button that sends a signal (input) and an LED that lights up (output).

👉 Think of this as the robot’s eyes and hands.

🧩 Fun Guide to In/Out Blocks (Clu-blocks Pro)

⚠️ Important! Always use the setup blocks first before trying to read or write to a pin. If you skip setup, your robot won’t know what to do — and nothing will work!

#BlockWhat it doesDropdown optionsWhat the options mean
1HIGHSets a digital signal to ONHIGH, LOWHIGH = ON (power), LOW = OFF (no power)
2setup pin# as Digital Output pin# 2Prepares pin 2 to send signalsDigital Output, Digital Input, PULLUP, pull down inputDigital Output: send signals (e.g. turn on LED)
Digital Input: receive signals (e.g. read button)
PULLUP / pull down: stabilize button readings
3Digital Output pin# 2 Stat HIGHSends a signal to pin 2 (e.g. turn on LED)HIGH, LOWChoose if the pin should be ON (HIGH) or OFF (LOW)
4get Digital Input pin# 2 valueReads if pin 2 is ON or OFFUseful for checking if a button is pressed
5Analog Input pinAO Ref VoltageStat 3.3VSets the voltage reference for analog readings3.3V, 2.2V, 1.5V, 1.2VChoose the base voltage for better sensor accuracy
6Analog Input pinAO Ref ResolutionStat 3.3VSets the resolution for analog readings3.3V, 2.2V, 1.5V, 1.2VControls how detailed the sensor reading is
7get Analog Input pinAO valueReads the analog value from pin A0Great for sensors like light, temperature, or sliders
8setup PWMAnalog pin# as PWMAnalog Output pin# 2Prepares pin 2 to send PWM signalsNeeded for controlling brightness or motor speed
9PWMAnalog Output pin# 2 frequencyStat 2000Sets the speed of PWM pulses on pin 2Number (e.g. 2000 Hz)Controls how fast the signal pulses — affects smoothness
10get Touch Sensor pin# AO valueChecks if the touch sensor on pin A0 is touchedGreat for invisible buttons or touch-sensitive controls
11attachInterrupt pin# 2 mode RISING do attachInterrupt_funcSets up a reaction when pin 2 changesRISING, FALLING, CHANGERISING: when signal goes from OFF to ON
FALLING: when signal goes from ON to OFF
CHANGE: any change
12passDoes nothing (placeholder block)Used when you want to leave a function empty for now
13setup dac# as DACAnalog Output dac# 2Prepares DAC pin 2 to send smooth analog signalsNumber (2, 3)Needed for real analog output (not just ON/OFF)
14DACAnalog Output dac# 2 value 2Sends a smooth analog value to DAC pin 2Number (2, 3)Controls intensity or level (e.g. soft light, quiet sound)

🧠 Quick Tips for Students

  • Setup first, always! If you don’t tell the robot what the pin is for, it won’t work.
  • Dropdowns are your friends. They let you change how the block behaves — just click and choose.
  • Digital = ON/OFF, Analog = smooth values, PWM = fast pulses, Interrupts = instant reactions.

Let me know when you’re ready to send the next image — and I’ll build the same kind of guide for that category!

On this page