Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vilicvane/ruff-menu
Awesome Menu for Ruff LCD (lcd1602).
https://github.com/vilicvane/ruff-menu
Last synced: 20 days ago
JSON representation
Awesome Menu for Ruff LCD (lcd1602).
- Host: GitHub
- URL: https://github.com/vilicvane/ruff-menu
- Owner: vilicvane
- Created: 2016-04-25T09:14:24.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-06-27T04:25:46.000Z (over 8 years ago)
- Last Synced: 2024-11-30T15:42:00.606Z (23 days ago)
- Language: TypeScript
- Size: 18.6 KB
- Stars: 8
- Watchers: 4
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Ruff Menu
Awesome Menu for Ruff LCD (lcd1602).
GitHub
![LCD](https://cloud.githubusercontent.com/assets/970430/14779534/17cbf1d2-0b0b-11e6-9025-bc528a3f96f2.jpg)
## Install
```sh
rap install menu
```## Usage
Here's a example creating multi-level menu:
```js
'use strict';var Menu = require('menu');
var lcd;
var menu;$.ready(function (error) {
if (error) {
console.log(error);
return;
}lcd = $('#lcd');
lcd.hideCursor();menu = new Menu(lcd, [
{
text: 'Option One',
value: 'one'
},
{
text: 'Option Two',
value: 'two'
},
{
text: 'Nested Menu',
items: [
{
text: 'Sub Option One',
value: 'sub.one'
},
{
text: 'Sub Option Two',
value: 'sub.two'
},
{
text: 'Nested Nested Menu',
items: [
{
text: 'vane.life',
value: 'http://vane.life'
}
]
}
]
},
{
text: 'Cancel'
}
]);$('#button-k2').on('push', function () {
menu.next();
});$('#button-k3').on('push', function () {
menu.select();
});menu
.show()
.then(function (result) {
lcd.print('result:', result || '(empty)');
});
});$.end(function () {
menu.hide();
});
```## License
MIT License.