arduino
Open-source platform for Arduino microcontrollers in IoT and embedded projects
What this skill does
# arduino
## Purpose
This skill provides tools for programming and managing Arduino microcontrollers, focusing on IoT and embedded systems development. It leverages the Arduino ecosystem to compile, upload, and interact with sketches on hardware like Arduino Uno or ESP32 boards.
## When to Use
Use this skill when building IoT prototypes, such as sensor networks or automated devices, that require microcontroller programming. Apply it for tasks like reading data from sensors (e.g., temperature via DHT11) or controlling actuators (e.g., LEDs, motors), especially in projects involving real-time data processing or hardware integration with platforms like Raspberry Pi.
## Key Capabilities
- Compile and upload Arduino sketches to boards using CLI commands.
- Manage boards, cores, and libraries for various Arduino-compatible hardware.
- Handle serial communication for debugging or data exchange in IoT setups.
- Integrate with external sensors and actuators through standard Arduino libraries.
- Support for multiple platforms, including AVR, ARM, and ESP-based boards.
## Usage Patterns
To use this skill, invoke Arduino CLI commands from scripts or directly in AI workflows. Always ensure the Arduino CLI is installed via `curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | sh`. For automation, wrap commands in shell scripts or Python subprocess calls. Specify the fully qualified board name (FQBN) for all operations, e.g., "arduino:avr:uno". If integrating into a larger AI agent flow, check for board connectivity first using `arduino-cli board list`.
## Common Commands/API
Use the Arduino CLI for core operations. Key commands include:
- Install a board core: `arduino-cli core install arduino:avr`
- Compile a sketch: `arduino-cli compile --fqbn arduino:avr:uno --output-dir /tmp/build path/to/sketch.ino`
- Upload a sketch: `arduino-cli upload -b arduino:avr:uno -p /dev/ttyUSB0 path/to/sketch.ino`
- List available boards: `arduino-cli board list`
- Add a library: `arduino-cli lib install "DHT sensor library"`
Code snippets:
1. Compile and upload a basic blink sketch:
```cpp
void setup() { pinMode(LED_BUILTIN, OUTPUT); }
void loop() { digitalWrite(LED_BUILTIN, HIGH); delay(1000); digitalWrite(LED_BUILTIN, LOW); delay(1000); }
```
Run: `arduino-cli compile --fqbn arduino:avr:uno blink.ino && arduino-cli upload -b arduino:avr:uno -p /dev/ttyUSB0 blink.ino`
2. Manage libraries in a script:
```bash
arduino-cli lib search DHT && arduino-cli lib install "DHT sensor library"
```
Config formats: Use JSON for CLI config files (e.g., `arduino-cli config init` creates a directories.json). Example snippet for a config file:
```json
{
"board_manager": {
"additional_urls": ["https://downloads.arduino.cc/packages"]
}
}
```
If Arduino Cloud integration is needed (e.g., for IoT services), set auth via environment variable: `export ARDUINO_API_KEY=$ARDUINO_API_KEY`.
## Integration Notes
Integrate this skill by ensuring Arduino CLI is in your PATH. For cross-platform use, detect the serial port dynamically (e.g., `/dev/ttyUSB0` on Linux or `COM3` on Windows). When combining with other IoT tools, pipe output to parsers like jq for JSON handling. For example, in a bash script: `arduino-cli board list | jq '.boards[] | select(.port == "/dev/ttyUSB0")'`. If using Arduino Cloud APIs, authenticate with `$ARDUINO_API_KEY` and make requests to endpoints like `https://api2.arduino.cc/iot/v2/things`. Always verify hardware connections before commands to avoid failures.
## Error Handling
Always check CLI exit codes; a non-zero code indicates failure (e.g., `if [ $? -ne 0 ]; then echo "Compilation failed"; fi`). Parse error output for specifics, like missing libraries: "error: 'DHT' not declared". Common issues include incorrect FQBN—verify with `arduino-cli board listall`—or port conflicts; use `ls /dev/tty*` to list ports. For upload errors, ensure the board is in bootloader mode. In scripts, wrap commands in try-catch blocks if using languages like Python:
```python
import subprocess
try:
subprocess.run(['arduino-cli', 'compile', '--fqbn', 'arduino:avr:uno', 'sketch.ino'], check=True)
except subprocess.CalledProcessError as e:
print(f"Error: {e.output}")
```
Log detailed errors for debugging IoT deployments.
## Graph Relationships
- Cluster: iot (directly linked to other skills in the iot cluster)
- Tags: iot (connects to skills with iot tag, e.g., for combined IoT workflows), arduino (links to specialized embedded system skills)
- Related skills: Any with iot tag, such as those for Raspberry Pi or ESP32, for expanded IoT capabilities
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.