How to use the avrgirl-arduino.list function in avrgirl-arduino

To help you get started, we’ve selected a few avrgirl-arduino examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github flaki / clouduboy / flasher / app / flasher.js View on Github external
return new Promise(function(resolve, reject) {
    Avrgirl.list(function(err, ports) {
      if (err) return reject(err);

      // Find (first) Arduboy device
      for (let p of ports) {
        // Bootloader mode
        if (p.vendorId === '0x2341' && p.productId === '0x8036') {
          return resolve(p.comName);
        }
        // Recovery mode
        if (p.vendorId === '0x2341' && p.productId === '0x0036') {
          return resolve(p.comName);
        }
      }

      reject(new Error("Can't find any connected Arduboy device!"));
    });

avrgirl-arduino

A NodeJS library for flashing compiled sketch files to Arduino microcontroller boards.

MIT
Latest version published 3 years ago

Package Health Score

54 / 100
Full package analysis

Popular avrgirl-arduino functions