Files
reactor/advanced-reactor.js

24 lines
584 B
JavaScript
Raw Normal View History

module.exports = function(RED) {
function reactor(config) {
RED.nodes.createNode(this, config);
var node = this;
let name = config.name;
2025-06-12 12:52:32 +02:00
const Reactor = require('./dependencies/reactor_class');
const reactor = new Reactor(Array(13).fill(0.001));
node.on('input', function(msg, send, done) {
if (msg.topic == "clock") {
reactor.updateState(msg);
}
if (done) {
done();
}
2025-06-12 12:52:32 +02:00
});
}
RED.nodes.registerType("advanced-reactor", reactor);
2025-06-12 12:52:32 +02:00
};