usb

python pygame.camera.init() NO vidcapture

主宰稳场 提交于 2019-12-19 03:13:09
问题 I am trying to initialize the camera module in pygame and display video from a usb webcam. This is my code: import pygame import pygame.camera from pygame.camera import * from pygame.locals import * pygame.init() pygame.camera.init() cam = pygame.camera.Camera("/dev/video0",(640,480)) cam.start() image = cam.get_image() Yet i get this error: Traceback (most recent call last): File "C:/Users/Freddie/Desktop/CAMERA/Test1.py", line 7, in <module> pygame.camera.init() File "C:\Python27\lib\site

Android USB Host - bulkTransfer() is losing data

末鹿安然 提交于 2019-12-18 18:33:36
问题 I'm trying to receive data from a custom device based on an FTDI 2232H chip. I am using a simple Async FIFO mode, and the incoming data rate is 3.2MB/sec. Everything works perfectly with test code on my PC, but I'm having problems receiving data on my Toshiba Thrive. TDI's Android driver fails, so I am coding using Java. I can receive 95%+ of the data perfectly, but every once in a while the data 'sputters' and I get portions of the same 4-5K of data two or three times, then back to good data

How to read from a usb rfid reader?

偶尔善良 提交于 2019-12-18 18:01:54
问题 I have bought a usb rfid reader. How can I read data when user puts an rfid tag in front of the device? my computer identifies the device as an Human Interface Device. If it identified it as an com device it was much easier to read from the device with serialPort object but I dont know how to read from a usb device. Any help? 回答1: This is what I did when I had the same problem. using System; using System.Text; using LibUsbDotNet; using LibUsbDotNet.Main; namespace Examples { internal class

How to read from a usb rfid reader?

回眸只為那壹抹淺笑 提交于 2019-12-18 18:01:36
问题 I have bought a usb rfid reader. How can I read data when user puts an rfid tag in front of the device? my computer identifies the device as an Human Interface Device. If it identified it as an com device it was much easier to read from the device with serialPort object but I dont know how to read from a usb device. Any help? 回答1: This is what I did when I had the same problem. using System; using System.Text; using LibUsbDotNet; using LibUsbDotNet.Main; namespace Examples { internal class

How to list all attached USB devices in Visual C++

久未见 提交于 2019-12-18 17:33:32
问题 In Short: I need to detect hotplug events of my USB CDC device by PID/VID and get the corresponding virtual COM port which was created by Windows in Visual C++ and in the end create a dll. I have a USB CDC device which I need to be notified of when connected/disconnected on Windows. My approach is to use RegisterDeviceNotification and an "invisible" Window to receive WM_DEVICECHANGE notifications. This part is working so far. Now as far as I found out I need to get the list of USB devices

Open com port in php

主宰稳场 提交于 2019-12-18 17:08:31
问题 I have a usb 3G modem Huawei E1550 and Windows XP. I want to send sms with this modem trhow php. I use this function to open a modem com port: $fp = fopen ("COM3:", "wb+"); if (!$fp) { echo "Not open"; } else { echo "Open"; } And every time I get a error: Warning: fopen(COM3:) [function.fopen]: failed to open stream: Invalid argument in D:\Apache\htdocs\z91.ru\audio\test.php on line 3 回答1: You can also try removing the colon next to the COMn for this to work exec("mode COM3 BAUD=9600 PARITY=N

Handle all mouse events in Android

≡放荡痞女 提交于 2019-12-18 10:43:07
问题 Well, the question is rather simple - how can i handle left/right/middle click, wheel and (!)hover move in android 2/3/4. I've been digging on this topic and found the following in api 14 we can handle almost anything with fancy new MotionEvent we also have Open Accessory that seems to be ok with USB mouse since api 12 (still missing bluetooth) (UPD OA backported to 2.3.4) mouse actually works well on tablets with ICS and Honeycomb and cyanogen 2.3.7, but act like just single touch on every

Android USB host read from device

萝らか妹 提交于 2019-12-18 10:08:51
问题 I'm trying to get some data out of a USB device connected to my Android phone that is on host mode. I'm able to send data to it, but reading fails. I've looked at several examples and tried all I could but I don't have any experience in USB communication, although by now I know a little, and I've been stuck on this longer that I care to admit. I'm not very familiar with the endpoint configuration, but I know is that my device uses a CDC type communication method and both the output (from

What's the easiest, most practical way to toggle several lightbulbs with a PC? [closed]

若如初见. 提交于 2019-12-18 10:05:51
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 years ago . This question is mainly electronics related, but it also has a programming aspect. Some background on the problem We have a traffic light on a wall in our office. When people come in to the office, they can immediately tell from the traffic light whether last night's automatic build & test runs went smoothly:

Change default names for USB virtual serial ports in Linux

匆匆过客 提交于 2019-12-18 09:27:19
问题 I am developing an embedded solution using C and I am working with two USB sensors. If I connect each sensor alone they take this names: Device 1 (I do not know why it takes 6 names...) /dev/ttyACM0 /dev/ttyACM1 /dev/ttyACM2 /dev/ttyACM3 /dev/ttyACM4 /dev/ttyACM5 /dev/ttyACM6 Device 2 /dev/ttyACM0 So when I start as an embedded system and both sensors are connected, the fastest one takes /dev/ACM0 but it not always the same. So, when I try to read device 2 I could be reading device 1... I