# Arduino Official References and Best Practices Use these official Arduino resources before finalizing firmware or hardware guidance. ## Official References - Arduino main guide: - Arduino docs home: - Getting started path: - Arduino IDE usage: - Arduino language reference: - Arduino programming reference overview: - Arduino memory guide: - Arduino debugging fundamentals: - Arduino low-power design guide: - Arduino communication protocols index: - Arduino style guide for libraries: ## Firmware Best Practices - Keep the `loop()` non-blocking; avoid long `delay()` usage in production logic. - Use `millis()`-based scheduling for periodic tasks. - Budget SRAM explicitly and avoid dynamic allocation in hot paths. - Validate sensor ranges and provide safe defaults for invalid readings. - Add startup self-checks and periodic health heartbeat messages. - Version the payload schema and firmware version in every telemetry stream. - Implement retry with exponential backoff and jitter for network operations. - Store credentials outside source code and rotate them according to policy. ## Hardware and Power Best Practices - Document voltage levels, pin mapping, and current limits per peripheral. - Design for brownout and power fluctuation scenarios. - Use watchdog and safe recovery behavior where available. - Plan low-power modes for battery deployments and validate wake cycles. ## Integration Best Practices for Azure IoT - Prefer secure transports (MQTT over TLS) and per-device identity. - Define idempotent upstream processing for duplicate message scenarios. - Include device health metrics (uptime, reset reason, RSSI where applicable). - Validate offline buffering bounds to avoid uncontrolled memory growth.