{"id":26668,"library":"xod-arduino","title":"XOD Arduino Transpiler","description":"Transpiles XOD projects into Arduino C++ code. Version 0.37.0 is the current stable release. Part of the XOD visual programming ecosystem, this package provides the core compilation pipeline: given a XOD project and an entry patch, it generates Arduino sketch code. Differentiators: tight integration with XOD's node-based paradigm, support for multiple Arduino boards, and optimized code generation for embedded targets. Release cadence is tied to XOD's overall release schedule.","status":"active","version":"0.37.0","language":"javascript","source_language":"en","source_url":null,"tags":["javascript"],"install":[{"cmd":"npm install xod-arduino","lang":"bash","label":"npm"},{"cmd":"yarn add xod-arduino","lang":"bash","label":"yarn"},{"cmd":"pnpm add xod-arduino","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Provides project and node types used in transpilation.","package":"xod-project","optional":false},{"reason":"Utility functions for functional programming patterns used in the codebase.","package":"xod-func-tools","optional":false}],"imports":[{"note":"Default export, ESM-only. No named export.","wrong":"const transpileForArduino = require('xod-arduino')","symbol":"transpileForArduino","correct":"import transpileForArduino from 'xod-arduino'"},{"note":"This is a default export, not a named export.","wrong":"import { transpileForArduino } from 'xod-arduino'","symbol":"transpileForArduino","correct":"import transpileForArduino from 'xod-arduino'"},{"note":"Named export for sketch-level transpilation.","wrong":"const transpileSketch = require('xod-arduino').transpileSketch","symbol":"transpileSketch","correct":"import { transpileSketch } from 'xod-arduino'"}],"quickstart":{"code":"import transpileForArduino from 'xod-arduino';\nimport { loadProject } from 'xod-project';\n\nconst project = loadProject('/path/to/project.xod');\nconst code = transpileForArduino(project, '@/main');\nconsole.log(code);","lang":"javascript","description":"Transpile a XOD project to Arduino C++ code using the default entry point."},"warnings":[{"fix":"Ensure entryPointPath follows the exact patch path syntax, e.g. '@/main'.","message":"The second argument 'entryPointPath' must be a string starting with '@/' indicating a patch path in the project. Incorrect paths cause runtime errors.","severity":"gotcha","affected_versions":">=0.30.0"},{"fix":"Update to XOD 0.30+ and re-export the project.","message":"Older versions (<0.30) accepted a different project format. Projects created with XOD <0.30 must be migrated.","severity":"deprecated","affected_versions":"<0.30.0"},{"fix":"Check the XOD documentation for board compatibility.","message":"The transpiler does not support all Arduino boards equally. Unsupported features may produce incomplete code.","severity":"gotcha","affected_versions":">=0.30.0"},{"fix":"Use only flat patch hierarchies or ensure all referenced patches are resolvable.","message":"The transpiler expects a flat project structure. Nested patches may not be handled correctly.","severity":"gotcha","affected_versions":">=0.30.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run 'npm install xod-arduino xod-project' in your project directory.","cause":"Package not installed or not in node_modules.","error":"Error: Cannot find module 'xod-arduino'"},{"fix":"Use 'import transpileForArduino from 'xod-arduino' instead of '{ transpileForArduino }'.","cause":"Incorrect import style; using named import instead of default import.","error":"TypeError: transpileForArduino is not a function"},{"fix":"Provide a string like '@/main' where 'main' is a valid patch name.","cause":"Entry point path does not follow the required format.","error":"Error: Invalid entry point path. Must start with '@/'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}