morse2piezo

1.0.0 • Public • Published

morse2piezo

converts morse code notation to a piezo song for use with Johnny Five's Piezo class.

Usage

I recommend you use the morse package to convert your text into morse code notation first.

const morse2piezo = require('morse2piezo');
const morse = require('morse');
const five = require('johnny-five');
 
const sequence = morse.encode('hello world');
// first argument is the note / tone, second is the morse sequence.
const song = morse2piezo('B1', sequence);
 
five.Board().on('ready', () => {
  const piezo = new five.Piezo(9);
  piezo.play({song, tempo: 500});
});

Readme

Keywords

none

Package Sidebar

Install

npm i morse2piezo

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

2.82 kB

Total Files

4

Last publish

Collaborators

  • noopkat