8000 GitHub - arduino/micropython.js at 45e28c299ad3042523ebb7243c28a31c9a023cc9
[go: up one dir, main page]

Skip to content

arduino/micropython.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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
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

Contributors 2

  •  
  •  
0