Socket
Socket
Sign inDemoInstall

node-rpi-si4703

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    node-rpi-si4703

Node JS wrapper for the rpi-si4703 FM tuner library.


Version published
Weekly downloads
3
Maintainers
1
Created
Weekly downloads
 

Readme

Source

node-rpi-si4703

Node wrapper for the rpi-si4703 library. For use with the Si4703 breakout board at sparkfun.


Usage

Currently you must run as sudo to access the hardware.

Make sure you have the wiring pi library installed.

You can use callbacks or you can promisify it with bluebird. The following example is with callbacks.

var FMTuner = require('node-rpi-si4703');

var tuner = new FMTuner(23, 0); //GPIO 23 for reset, and SDA for i2c (GPIO 0)

tuner.powerOn((err) => {
  //Check err for any errors before moving on (err is a string by the way)

  //Set to 103.3 Moody Radio Cleveland
  tuner.setChannel(1033, (err) => {
    //Now turn it up! (Volume range is 0-15)
    tuner.setVolume(15, (err) => {
      //Enjoy your FM radio!
    });
  });
});


Methods

All methods have a callback with error as the first parameter and any result as the second parameter.

  • powerOn - Turns on radio
  • powerOff - Turns off radio
  • setChannel - Sets a radio channel, pass a frequency multiplied by 10. For example 1033 for 103.3 Mhz
  • getChannel - Gets the current channel the radio is on multiplied by 10
  • seekUp - Seek radio up
  • seekDown - Seek radio down
  • setVolume - Set a volume between 0-15.
  • readRDS - Read the RDS message for a station. Pass the time out in milliseconds.

Keywords

FAQs

Last updated on 12 Aug 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc