Tag: raspberry pi2

覆盆子pi邻近检测nodejs

我有一个运动和接近传感器连接到树莓派。 我想要发生的事情是,当运动传感器检测到运动时,它从接近传感器获取读数以查看人的距离。一旦人进入一定的距离,就会显示一条消息。 运动传感器正在被触发,我正从接近传感器读取数据,但接近传感器陷入一个循环,数值不会更新(即使有人在其上)。 议案: import gpio from 'gpio'; import proximity from './proximity'; const gpio4 = gpio.export(4, { direction: 'in', }); // bind to the "change" event gpio4.on('change', (val) => { // value will report either 1 or 0 (number) when the value changes if (val === 1) { console.log('checking proximity'); proximity.getDistance(); } }); 接近 : […]

如何在Windows 10 IOT核心上将Node.js Windows通用应用程序设置为启动应用程序

我已经从Microsoft IOT Github页面创build了示例Hello, World Node.js Windows Universal Sample ,但是现在我想要设置此后台应用程序来启动。 我知道我应该使用iotstartup ,但是我的应用名称是什么? 我看到的只是这个: [10.10.xx.xx]: PS C:\> iotstartup list Headed : 0ea49cba-1455-4d46-82bf-e3500f805e6b_wzgz7s44cm19c!App Headed : 135bb3b6-419d-4692-a777-c9131bc0a419_wzgz7s44cm19c!App Headed : DefaultApp_cw5n1h2txyewy!App Headed : IoTCoreDefaultApp_hz258y3tkez3a!App Headed : Windows.MiracastView_cw5n1h2txyewy!Microsoft.Windows.MiracastView Headed : ZWaveBackgroundService_6efsg6e0hggwa!App Headless : ZWaveBackgroundService_1.0.0.0_arm__6efsg6e0hggwa Headless : 0ea49cba-1455-4d46-82bf-e3500f805e6b_1.0.0.0_arm__wzgz7s44cm19c Headless : 135bb3b6-419d-4692-a777-c9131bc0a419_1.0.0.0_arm__wzgz7s44cm19c

npm rpi-gpio安装错误

我想安装rpi-gpio模块来通过HTTP控制引脚,但是当我安装这个模块时,会引发以下错误: pi@raspberrypi:~/Desktop $ sudo npm install rpi-gpio epoll@0.1.17 install /home/pi/node_modules/rpi-gpio/node_modules/epoll node-gyp rebuild make: Entering directory '/home/pi/node_modules/rpi-gpio/node_modules/epoll/build' CXX(target) Release/obj.target/epoll/src/epoll.o In file included from ../src/epoll.cc:15:0: ../node_modules/nan/nan.h:328:47: error: 'REPLACE_INVALID_UTF8' is not a member of 'v8::String' static const unsigned kReplaceInvalidUtf8 = v8::String::REPLACE_INVALID_UTF8; ^ epoll.target.mk:84: recipe for target 'Release/obj.target/epoll/src/epoll.o' failed make: *** [Release/obj.target/epoll/src/epoll.o] Error 1 make: Leaving directory '/home/pi/node_modules/rpi-gpio/node_modules/epoll/build' gyp […]