ERROR MESSAGE: fs.js:429 return binding.write(fd, buffer, offset, length, position); ^ Error: EINVAL, invalid argument at Object.fs.writeSync (fs.js:429:18) at Object.fs.writeFileSync (fs.js:764:21) at Object.f.analogWrite (/usr/lib/node_modules/bonescript/index.js:546:12) at loop (/var/lib/cloud9/analog.js:11:7) at Object. (/var/lib/cloud9/analog.js:7:1) at Module._compile (module.js:449:26) at Object.Module._extensions..js (module.js:467:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Module.runMain (module.js:492:10) Second of the two changes in your patch did not have the 'this.' prefix: if(f.getPlatform().name == 'Beaglebone') data = data / this.scale;