Skip to content

arduino/micropython.js

Repository files navigation

micropython.js

This is an partial port of pyboard.py to javascript.

Basic usage

const Board = require('micropython.js')
// Instantiate board class
const board = new Board()

// List available boards
const ports = await board.listPorts()
console.log('available boards', ports)

// Connect to a serial path
await board.open('/dev/ttyUSB0')

// Enter raw repl, execute command, get output and leave raw repl
await board.enter_raw_repl()
const output = await board.exec_raw({ command: "print(123)" })
await board.exit_raw_repl()

// List files on the board
const rootFiles = await board.fs_ils()
console.log('files at /', rootFiles)

// Close serial
await board.close()

Examples

  1. Navigate to example folder cd examples
  2. Execute files with PORT environment variable: PORT=/dev/tty.SLAB_USBtoUART node 05_list_files.js

Command Line Interface (CLI)

  1. Run CLI node cli.js [ARGUMENTS]...

Read more

About

No description, website, or topics provided.

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

  •  

Packages

No packages published
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy