node-gqgeiger
An abstraction library for communicating with the GQ Electronics GMC range of Geiger counters
Note for Windows users
If you are having trouble connecting your Geiger counter via USB, it's possible that the latest Prolific drivers on your PC are rejecting the chip in the device. Click here for a fix!
Confirmed compatibility
- GMC-320 Plus
Please make a pull request for this README if the library works on your (different) counter!
Install
npm install --save gqgeiger
Quick Example
const GQGeiger = ; const myGeiger = "COM4" 9600; ;
API
new GQGeiger(string portName, number baudRate)
Connects to the Geiger counter.
Arguments
- portName - The name of the port to open. Windows ports are typically labeled
COMn
, where n is the port number. - baudRate - The baud rate of the device. The default for the GMC-320 is
9600
.
getCPM(function callback)
Gets the current counts-per-minute value from the Geiger counter.
Arguments
- callback(mixed err, number cpm)
getDoseRate(function callback)
Gets the current dose rate from the Geiger counter in μSv/h.
Arguments
- callback(mixed err, number doseRate)
getVoltage(function callback)
Gets the current Geiger counter battery voltage.
Arguments
- callback(mixed err, number voltage)
getSerial(function callback)
Gets the Geiger counter's serial number.
Arguments
- callback(mixed err, string serial)
getTemp(function callback)
Gets the current temperature from the Geiger counter in degrees Celsius.
Arguments
- callback(mixed err, number temp)
getGyro(function callback)
Gets the current gyroscope values from the Geiger counter in two-byte buffers.
Arguments
- callback(mixed err, object gyro)
- gyro.x - Two-byte buffer of the x value of the gyroscope
- gyro.y - Two-byte buffer of the y value of the gyroscope
- gyro.z - Two-byte buffer of the z value of the gyroscope
reboot()
Restarts (or starts if off) the Geiger counter.
powerOff()
Powers off the Geiger counter.
powerOn()
Powers on the Geiger counter.