I'm looking to be able to display status information using a small LED or a small LCD screen connected through USB.
All I need to display is very simple status (standby, error, running).
Is there anything already made, decent looking and programmable through C++?
Are you looking for something like this ? Since it's USB HID class, it should be fairly trivial to control from C++ on both Windows and Linux. (And I assume Mac OSX wouldn't be that hard either)
The Logitech G15 has one.
Related
I just want to know if its possible to write a program in c++ on Windows which can grab frames of video from a web cam by making use of a USB library like libusb.
I have looked at http://www.dreamincode.net/forums/topic/148707-introduction-to-using-libusb-10/ . They define a basic sequence of the steps one must follow while using libusb to work with usb devices. To summarize:
1) Find and connect to the USB device
2) Send and receive data
3) Release the USB device
libusb handles part 1) and 3). So, the question comes down to part 2). I wonder if it is possible/feasible to send commands to the camera and receive data via USB by adhering to some type of standard (UVC 1.5 for example). I'm thinking that not knowing some proprietary, device specific information might be a problem though.
If this is possible but super hard, I would appreciate any insights into what the biggest challenge would be.
The hardware I have in mind are low-end logitech USB cameras.
Also, I am fully aware that OpenCV, Video for Windows (VFW), DirectShow, and FFMPEG can do web-cam video capture. I am interested in this project as a learning experience.
Thanks in advance!
Since you're obviously a bit inexperienced, I'll give an answer in high-level terms.
To talk to someone, or something, you need to speak a common language, or have a translator. Now, there are many different USB devices, and they speak many different languages, but OpenCV can act as a translator for many of those. If you don't want to use that, you will need to find another translator, or possibly learn to speak the camera's native language.
The first option (another translator) is no option for you, because you don't want a translator.
The second option is something we can't help you with, because we don't know which camera you have.
I bought a physical button and hooked it up to my computer, using the Arduino it communicates over USB serial to a C++ program I'm writing. Now I want to make the button simulate a keypress on my computer so I could use it as an alternative controller for the games I play.
If you are not familiar with Arduino, don't mind it, my problem lies completely in C++
The solution for this is pretty simple, it basically boils down to using SendMessage to a window with keystrokes, or many alternative methods like sendKeys and what not.
I have tried every single library or windows function that could handle something like this, but none of them actually simulates a keystroke being pressed by a keyboard.
Everything I tried so far has worked in many programs like Notepad and Chrome but none works with a game that doesn't listen to windows messages to handle key input.
My guess is that these games use GetAsyncKeyState which is communicating with the physical keyboard in a direct manner.
How could I resolve this? What API provides such functionality?
I need something very low level here, maybe even a program that emulates a new keyboard so windows thinks I have plugged in a physical one.
This would help me ALOT I've encountered this problem numerous times and I will keep encountering it in the near future with other projects.
I hope someone can help,
Thanks!
Use keybd_event() or SendInput()
I need example of code (or some tutorial) for making virtual HID (Human Interface Device).
If possible with bluetooth integration and made for linux using QT/C++.
Practically, I want to make my own cellphone application which will have few buttons (but it will work as keyboard - sending keystrokes), without requiring server-side application (it will control windows/linux/mac operating systems), and HID seems to me best choice. Unfortunately, I can't find any code samples or tutorials for that.
The thing is I don't know how I am supposed to make service and register it (make it available over bluetooth so OS can recognize it as keyboard and pair with it).
So far I have found about BlueZ, but as I mentioned, I cant find any code samples or tutorials.
UPDATE: I am trying to make my cellphone (Nokia N9 - Maemo 6/MeeGo OS - Linux) to pretend as HID device via BlueTooth so I can send keystrokes to PC.
The first question that comes into my mind is this usb device made by you ?
I don't understand what making my own cellphone application means . So you have a device that is a cell phone or what please be more explicit
Anyway a solution for you might be the libusb library works very well on both windows and linux machines.
If you need to study about usb hid devices and how to interact with them you can find a lot of very good tutorials here.
Please be more explicit in order to help you.
I'm trying to write an application that will take specific action when it detects an overcurrent condition on any USB port.
However, my googlefu is not able to come up with anything useful (though I can now tell you 101 ways to fix a USB overcurrent problem).
Is there are standard windows API to retrieve USB status info?
If not is there another/better way to detect USB overcurrent conditions programatically?
As far as I can see here http://msdn.microsoft.com/en-us/library/ff539687 you need to turn to the WDK (Window Driver Kit).
I want to develop code to transmit data from system to PIC through USB.
Can anybody give good link regarding data transmission through USB.
because i am new to this.
NOTE: Very simple is code is enough to me.
Thanks in Advance
The PIC16F877 does not have a USB peripheral built in. I assume that the product that you are building is a "USB Device" and that the "system" that you are referring to will provide the USB host functionality. If this is the case then you will have to add a USB interface chip to your hardware to provide async serial to USB connectivity. Suitable devices are made by TI (TUSB series) or FTDI. You then connect one of these to the PIC internal USART and pretend that you are transferring the data over a simple serial port. If you are using a pc then the connected device will appear as a standard COMn: port.
I totally agree with the FTDI route, however if you're not looking for a UART tunnel over USB then you have to get a bit more in-depth.
You'll have to write the USB routines yourself or find libraries/projects for your processor. What you will definitely have to have is a fast clock - 12MHz is necessary More is better because on small uC's like these you'll spend most of your time just handling the basics of USB - signaling and so forth. You'll also need a fair bit of memory because the USB code takes up around 1.5K I think. Then you need room afterwards for your own code.
I've seen the V-USB (http://www.obdev.at/products/vusb/index.html). It's for AVR not PIC, but it says it provides all of the USB functionality you'll need and even provides vendor and product IDs for you to use (non-commercial I believe). There's also a PIC project for USB that doesn't run on the same hardware as yours here: http://www.alanmacek.com/usb/
To make the driver you'll have to use libusb - here's a link for the win32 version: http://libusb-win32.sourceforge.net/
It's surprisingly more simple than I had expected, but I just looked at example code and not actually made anything. Good luck!
As your task will involve Windows Device Driver development, I do recommend to downlaod and install the WDK and look through the contained sample USB drivers.
This might get you some hints about the complexity of the topic. Device driver development is not the easiest thing to start with.
Maybe you can start with UART communication (RS232).
check http://www.beyondlogic.org/usbnutshell/pic16f876.gif will surely help u
also
ttp://www.beyondlogic.org/usbnutshell/usb7.htm , type h in front of 2nd link.