Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create DPT-surface.js #102

Merged
merged 2 commits into from
Dec 18, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions sentences/DPT-surface.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/**
Depth:
$IIDPT,x.x,x.x,,*hh
I I_Sensor offset, >0 = surface transducer distance, >0 = keel transducer distance.
tkurki marked this conversation as resolved.
Show resolved Hide resolved
I_From Surface To Transduder

*/
// NMEA0183 Encoder DPT $IIDPT,69.21,-0.001*60
const nmea = require('../nmea.js')
module.exports = function (app) {
return {
sentence: 'DPT',
title: 'DPT - Depth at Surface (using surfaceToTransducer)',
keys: [
'environment.depth.belowTransducer',
'environment.depth.surfaceToTransducer'
],
f: function dpt (belowTransducer, surfaceToTransducer) {
return nmea.toSentence([
'$IIDPT',
belowTransducer.toFixed(2),
surfaceToTransducer.toFixed(3)
tkurki marked this conversation as resolved.
Show resolved Hide resolved
])
}
}
}
Loading