我试图动态列出连接到计算机的USB与某个UsbDeviceClass匹配
有关我尝试在设备管理器中列出的USB类的信息如下
理想情况下它应该能够列出Com端口,因为我希望列出的设备特别是Arduinos.
DeviceInformationCollection usbDeviceInfoCollection = await DeviceInformation.FindAllAsync(UsbDevice.GetDeviceClassSelector(new UsbDeviceClass()
{
ClassCode = 0x02,
SubclassCode = 0x02,
ProtocolCode = 0x01
}));
Debug.WriteLineIf(usbDeviceInfoCollection.Count == 1, "1 USB device found");
Debug.WriteLineIf(usbDeviceInfoCollection.Count != 1, usbDeviceInfoCollection.Count + " USB devices found");
for (int i = 0; i < usbDeviceInfoCollection.Count; i++)
{
Debug.WriteLine("USB Device " + (i + 1));
Debug.WriteLine("ID: " + usbDeviceInfoCollection[i].Id);
Debug.WriteLine("Name: " + usbDeviceInfoCollection[i].Name);
Debug.WriteLine("Properties: " + usbDeviceInfoCollection[i].Properties);
Debug.WriteLine("");
}
Run Code Online (Sandbox Code Playgroud)
上面的代码显示了我一直在努力实现这一目标,但到目前为止,我没有运气.这是因为当程序运行时,它会在连接了设备时返回0个设备.
我也尝试使用预定义的类UsbDeviceClasses.CdcControl,但是,也没有达到我想要的结果.
我很欣赏任何关于如何正确实现这一目标的指导.
此外,由于这是一个UWP项目,我已经包含了下面的功能,因此它应该能够检测到我想要的设备.
<DeviceCapability Name="serialcommunication">
<Device …Run Code Online (Sandbox Code Playgroud) 我正在尝试将.hex文件上传到Arduino.通过IDE上传代码没有任何问题(如眨眼示例或其他任何内容).端口和板是正确的.
因此,当我尝试上传时出现问题
avrdude -pm328p -carduino -P/dev/tty.usbmodemfd121 -b57600 -D -Uflash:w:grbl_v0_8c_atmega328p_16mhz_9600.hex -v -v -v -v
avrdude: Version 6.1, compiled on Mar 23 2014 at 04:42:55
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch
System wide configuration file is "/usr/local/Cellar/avrdude/6.1/etc/avrdude.conf"
User configuration file is "/Users/Mikhail/.avrduderc"
User configuration file does not exist or is not a regular file, skipping
Using Port : /dev/tty.usbmodemfd121
Using Programmer : arduino
Overriding Baud Rate : 57600
avrdude: Send: 0 [30] [20]
avrdude: Send: 0 [30] …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用蓝牙低功耗(BLE)通过Android应用程序连接到Arduino Uno.
我正在开发Android Studio,使用三星Galaxy S4进行测试,使用Android版本5.0.1
我按照以下链接开发:http
://www.truiton.com/2015/04/android-bluetooth-low-energy- ble-example /
我正在扫描设备,当我找到它时,我想在连接它之前得到它的UUID,以确保它是正确类型的设备:
mScanCallback = new ScanCallback() {
@Override
@TargetApi(21)
public void onScanResult(int callbackType, ScanResult result) {
BluetoothDevice btDevice = result.getDevice();
ParcelUuid[] uuids = btDevice.getUuids(); //<-- this is always null!! :(
Log.d(TAG, ""+btDevice.fetchUuidsWithSdp()); //<-- prints true.
Log.d(TAG, "result : " + result.toString()); //<-- prints a bunch of relevant info that contains the UUID I want to check.
Log.d(TAG, "uuids : " + uuids); //<-- prints null.
/*
for (ParcelUuid u : …Run Code Online (Sandbox Code Playgroud) uuid android bluetooth-lowenergy android-bluetooth arduino-uno
环境
期望的行为
我正在尝试将三个值从Python应用程序发送到Arduino.
从终端执行以下操作时,它可以工作:
$ python
$ import serial
$ import struct
$ ser = serial.Serial('/dev/ttyACM0', 9600)
$ ser.write(struct.pack('>3B', 255, 0, 0))
Run Code Online (Sandbox Code Playgroud)
当前行为
在Python文件中使用相同的代码时它不起作用,即:
import serial
import struct
ser = serial.Serial('/dev/ttyACM0', 9600)
ser.write(struct.pack('>3B', red_value, green_value, blue_value))
Run Code Online (Sandbox Code Playgroud)
错误信息
$ sudo tail -100 /var/log/apache2/error.log
OSError: [Errno 13] Permission denied: '/dev/ttyACM0'
Run Code Online (Sandbox Code Playgroud)
故障排除
权限
申请文件:
$ ls -l
-rwxr-xr-x 1 myname mygroupname 114146 Jan 9 19:16 my_application.py
Run Code Online (Sandbox Code Playgroud)
ttyACM0:
ls -l /dev/ttyACM0
crw-rw---- 1 root …Run Code Online (Sandbox Code Playgroud) 我正在尝试将 HC-05 蓝牙模块(连接到 Arduino Uno)连接到我的 Raspberry Pi 3,希望实现两者之间的蓝牙通信,以将数据从 Uno 发送到 Pi。
尝试使用 Bluetoothctl 配对、连接和信任 HC-05 设备对我来说似乎失败了。
[bluetooth]# power on
Changing power on succeeded
[bluetooth]# agent on
Agent registered
[bluetooth]# scan on
[CHG] Device 98:D3:31:FB:6F:F1 LegacyPairing: yes
[CHG] Device 98:D3:31:FB:6F:F1 RSSI: -43
[bluetooth]# pair 98:D3:31:FB:6F:F1
Attempting to pair with 98:D3:31:FB:6F:F1
[CHG] Device 98:D3:31:FB:6F:F1 Connected: yes
Request PIN code
[agent] Enter PIN code: 1234
[CHG] Device 98:D3:31:FB:6F:F1 Paired: yes
Pairing successful
[CHG] Device 98:D3:31:FB:6F:F1 Connected: no
[bluetooth]# connect 98:D3:31:FB:6F:F1
Attempting to connect …Run Code Online (Sandbox Code Playgroud) 嗨,我正在尝试实现我的库通过TCP连接发送数据.在Quectel的官方文档中,他们允许您选择AT + QIMODE = 1,也称为透明模式,其中从UART发送的所有数据都通过tcp连接发送.我试图在发送数据之前检查连接状态,因此希望更改为命令模式并使用AT + QISTAT.我尝试向芯片发送'+++',但它正在向我的服务器发送'+++',所以它不起作用.任何帮助是极大的赞赏.
链接到官方文档,请参阅第162页第7.2.21节
我有一个Arduino Uno并且代码昨天加载正常但今天我一直收到以下错误(通过将上传部分设置为详细显示)
avrdude: Version 5.11, compiled on Sep 2 2011 at 18:52:52
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2009 Joerg Wunsch
System wide configuration file is "/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf"
User configuration file is "/Users/seanwhipple/.avrduderc"
User configuration file does not exist or is not a regular file, skipping
Using Port : /dev/tty.usbmodemfa131
Using Programmer : arduino
Overriding Baud Rate : 115200
avrdude: Send: 0 [30] [20]
avrdude: Send: 0 [30] [20]
avrdude: Send: 0 [30] [20]
avrdude: ser_recv(): programmer is not …Run Code Online (Sandbox Code Playgroud) 我是arduino编程的新手.几乎没有经验.
我希望对我的arduino Uno板进行编程,以读取PT100 RTD传感器的2/3/4线配置(精度等级至少为0.5°C).温度范围为0至400°C和-50至100°C.
由于我对这个领域完全陌生,我会欣赏有关电路,图像和代码的相当描述性的信息.
我已经对这个问题进行了很多研究,但是无法解决我的问题.
此外,我不能使用热敏电阻或任何IC来读取温度,因为安装RTD的机器具有PID,但我想创建一个可以在计算机上获取温度的数据记录器.
我使用twitter streaming api及johnny-five与其他一些模块http,express及socket.io用arduino uno
我的脚本在笔记本电脑上运行良好.但我的制作将在平板电脑上.我有两个平板电脑,两者都有不同的反应.在hp omni平板电脑上我收到以下错误
此外,我已arduino-uno连接端口,COM3但其显示设备已连接COM1
据我所知,这个错误是standard firmata在arduino没有上传的时候引起的.我上传了这个程序,它在笔记本电脑上运行良好
在Acer平板电脑上我没有收到任何错误程序启动完全没有任何问题,但我没有收到推文twitter streaming api
我已多次交叉检查它在笔记本电脑上运行完全正常,每次我运行它,但给出了两个不同的问题 tablets
这是我正在使用的代码
var Twitter = require('twitter');
var five = require("johnny-five");
var express = require('express')
, app = express()
, http = require('http')
, server = http.createServer(app)
, io = require('socket.io').listen(server);
server.listen(8080);
// routing
app.use(express.static(__dirname + '/http'));
app.use(function (req, res, next) {
res.setHeader('Access-Control-Allow-Origin', "http://"+req.headers.host+':80');
res.setHeader('Access-Control-Allow-Methods', …Run Code Online (Sandbox Code Playgroud) javascript node.js twitter-streaming-api arduino-uno johnny-five
arduino-uno ×10
arduino ×6
arduino-ide ×2
macos ×2
android ×1
at-command ×1
avrdude ×1
bluetooth ×1
c# ×1
gsm ×1
javascript ×1
johnny-five ×1
linux-mint ×1
mobile ×1
node.js ×1
pyserial ×1
python-2.7 ×1
robotics ×1
rtd ×1
temperature ×1
uuid ×1
uwp ×1
xaml ×1