This repo contains frontend (Vue), backend (Node + TypeScript + Socket.io + Express + SerialPort) and Arduino code for controlling a flatbed scanner and a rotating plate powered by a stepper motor.
- Make sure the scanner is plugged in and no other scanning utility is open
- Plug in Arduino (for testing, adding the stepper motor is optional)
- Run
yarn start
- Open localhost:3000
- Set the options and click "Start"
There is some useful debugging info in console.
- Frontend (hosted on localhost:3000) contains an interface to set multiple options for scanning and rotating the plate. It sends these options to backend and receives live updates on progress.
- Backend controls the scanner (via scanline cli tool) and stepper motor (via SerialPort).
- Arduino microcontroller receives commands from backend, executes them, and sends status updates back.
Arduino controls a A4988 stepper driver. It sets the driver to SLEEP mode inbetween running. Messages are received over USB.
cw
set direction clockwiseccw
set direction counter-clockwisestart
start the stepper motor and run indefinitelystop
stop stepper motorslowspeed
set motor speed to slowmediumspeed
set motor speed to mediumfastspeed
set motor speed to fast1..32767
if numeric value is sent, motor will go the specified number of steps and stop
finished
has finished executing the specified amount of steps