123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
-
-
-
-
-
- var upmMQ5 = require("jsupm_gas");
-
-
- var myMQ5 = new upmMQ5.MQ5(0);
-
- var threshContext = new upmMQ5.thresholdContext;
- threshContext.averageReading = 0;
- threshContext.runningAverage = 0;
- threshContext.averagedOver = 2;
-
-
- while(1)
- {
- var buffer = new upmMQ5.uint16Array(128);
- var len = myMQ5.getSampledWindow(2, 128, buffer);
- if (len)
- {
- var thresh = myMQ5.findThreshold(threshContext, 30, buffer, len);
- myMQ5.printGraph(threshContext, 5);
-
-
- }
- }
-
-
- process.on('SIGINT', function()
- {
- console.log("Exiting...");
- process.exit(0);
- });
|