https://github.com/progfay/3dprintercontroller
Controlling 3D Printer by G-Code with Serial communication
https://github.com/progfay/3dprintercontroller
Last synced: 3 months ago
JSON representation
Controlling 3D Printer by G-Code with Serial communication
- Host: GitHub
- URL: https://github.com/progfay/3dprintercontroller
- Owner: progfay
- Created: 2019-11-13T05:58:05.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-12-12T01:06:19.000Z (over 4 years ago)
- Last Synced: 2025-01-30T20:16:27.810Z (5 months ago)
- Language: JavaScript
- Size: 25.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 3D Printer Controller
Controlling 3D Printer by G-Code with Serial communication
## Setup
### Install dependencies
```sh
$ npm i
```### Set port ID
```sh
$ node port-list.js
```出力から1つを選び、 `Printer` のコンストラクタの第一引数にセットする
#### Sample
```js
const Printer = require('./lib/Printer')new Printer({
vendorId: 'XXXX',
productId: 'XXXX'
})
```## Usage
```js
const PRINTER_ID = {
vendorId: 'XXXX',
productId: 'XXXX'
}const Printer = require('./lib/Printer')
const main = async () => {
const printer = new Printer(PRINTER_ID)
await printer.connect()
await printer.initPosition()await printer.setSpeed(300)
await printer.moveTo({ x: 100, y: 200, z: 50 })
// or send G-Code manually
await printer.sengGCode('`G0 X200 Y50 Z200')
}main()
```