You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
vitrinekast 383d4ce39b change font size 3 months ago
public init server 3 months ago
.gitignore init server 3 months ago
app.js added reset message 3 months ago
hpgl.js change font size 3 months ago
package-lock.json added tmi to package.json 3 months ago
package.json added tmi to package.json 3 months ago
readme.md Add headers and code snippets to readme 3 months ago

readme.md

Twitch Plays Plotter

A javascript based project with which you can control a pen plotter through the chat of a Twitch livestream.

Setup

The channel you connect to is specified with the following lines. No authentication is needed, if you're only reading from the chat.

const client = new tmi.Client({
    channels: ['twitchplaysplotter']
});

The communicative channel with the plotter might depend on your specific plotter and the port it is connected to. This is specified with the following lines:

const port = new SerialPort({
    path: '/dev/ttyUSB0',
    baudRate: 9600,
})

Supported commands

The tale of the untested bit of javascript:

the commands are right now

  • lb and anything you type after will be plotted as Text
  • init
  • pu
  • pd
  • up (move up by {distance})
  • down (move down by {distance})
  • right (move right by {distance})
  • left (move left by {distance})
  • rectangle (draw a rectangle with the size of {distance})
  • circle (draw a rectangle with the size of {distance})
  • set the value for distance

Also, there is the start of some state tracking and clamping to prevent the plotter from getting stuck. But again, untested.