|
I want to use a Raspberry Pi Pico acting like a USB keyboard to set the system volume to absolute levels (like 0%, 20%, 40%, 60%, 80%, 100%). I don't really want to just do volume up/down. Ideally this device would work with Windows and Linux. Is it possible to send an absolute volume level via USB HID?
|
# ? Jun 8, 2022 19:20 |
|
|
# ? May 29, 2024 15:20 |
|
You could mash volume down a whole bunch until you're certain it's zero, then turn it up to the right level. That's assuming they're isn't a HID command to just do it, I haven't looked into it
|
# ? Jun 8, 2022 19:53 |
|
PBCrunch posted:I want to use a Raspberry Pi Pico acting like a USB keyboard to set the system volume to absolute levels (like 0%, 20%, 40%, 60%, 80%, 100%). I don't really want to just do volume up/down. Ideally this device would work with Windows and Linux. Is it possible to send an absolute volume level via USB HID? Not with a keyboard: keyboards send "key down" and "key up" events. And there's no guarantee how the computer is going to handle "volume up": does that mean increase by 3%? 5%? 10%? There are other USB HID devices that could do this, but you'd need something on the other end to listen.
|
# ? Jun 8, 2022 20:22 |
|
PBCrunch posted:I want to use a Raspberry Pi Pico acting like a USB keyboard to set the system volume to absolute levels (like 0%, 20%, 40%, 60%, 80%, 100%). I don't really want to just do volume up/down. Ideally this device would work with Windows and Linux. Is it possible to send an absolute volume level via USB HID? https://usb.org/sites/default/files/hut1_3_0.pdf#page=145&zoom=100,57,57 Section 15.9.1 if the anchor location doesn't work properly. Like cruft said you'd need to have some custom app talking to the USB device to do what you want. It probably wouldn't be super hard to do as a "my first libusb project" type thing but it definitely would not be as straightforward as having it act like a keyboard.
|
# ? Jun 8, 2022 22:12 |
|
I would much rather live with the volume up/down limitations than have to run some kind of custom driver on the host machine. Thanks for the input () though.
|
# ? Jun 8, 2022 22:46 |
|
Hi there, thread. I don't know jack poo poo about arduinos and raspberries and such, but wanted to do some research into what I think might be a fun learning project. Apologies if this is a very basic question - but when it comes to hardware I'd have to go and order and be stuck with, I'd rather not act on my own vague understanding of things. A couple days ago I've used a MIDI translator to use a piano keyboard as a stickless arcade controller for fighting games on a lark. Then I found I actually really like it and started training with it and coding own SOCD cleaners (rules for handling opposing directional directions to be ~tournament legal~). Now, while I don't really need it, I've started talking with some friends about making a for-funsies project of grabbing an arduino or something similar to make my own plug'n'play adapter to be able to just roll up to some local meetings or something. The thing I'd need this thing to do: - Read MIDI inputs, preferably through a USB cable. - Translate them to other key presses internally, so I don't have to install poo poo on target machine running the game and output them by another USB connection. - Be able to swap between modes of pretending to a PC or Playstation controller - I know the consoles have some different I/O standards, but I have no idea if it has any hardware/connector implications. - If it could just mooch power through these USB connectors and not require it's own power plug, it'd be super sweet. - Some case to be able to just chuck in into a backpack. Any considerations for Stuff To Fit Inside I should be aware of? What would I need to grab hardware-wise to possibly get such a gizmo to work?
|
# ? Jun 9, 2022 16:15 |
|
Yeah, that seems like a decent beginner project. I'm not sure what the most recommended keyboard HID capable Arduino is lately. Maybe the Teensy? First step would just be picking up one of those and then getting it to simulate keyboard inputs.
|
# ? Jun 9, 2022 16:22 |
|
ante posted:Yeah, that seems like a decent beginner project. Agreed that this is a great first project. For this project, for an absolute beginner, I recommend starting with a genuine Arduino Leonardo or Arduino Micro. It will do USB junk, and works with everything. My recommendation for programming it, for absolute beginners, is Arduino Create, which runs in the browser and even works on a Chromebook.
|
# ? Jun 9, 2022 19:57 |
|
One aspect I'm a little unsure of is what would I need to have an input USB and output USB working at the same time. From what I've gathered, due to USB hosts being a bit tricky, the options here are either Due or any of the other USB-friendly models with an added USB host shield?
|
# ? Jun 9, 2022 20:19 |
|
Lichtenstein posted:One aspect I'm a little unsure of is what would I need to have an input USB and output USB working at the same time. From what I've gathered, due to USB hosts being a bit tricky, the options here are either Due or any of the other USB-friendly models with an added USB host shield? Oh. Yeah. You can't be a USB host and a USB client at the same time on the same cable. You'll need two USB endpoint devices. My recommendation here is to just get some off-the-shelf USB to MIDI adapter, and run those pins into header pins on the Arduino, using the normal MIDI serial communications. I don't have any experience with a "USB host shield" but my hot take is that USB is a very complicated protocol, and juggling all the libraries to do this on a single device is going to be challenging. Might be a good milestone for the second version, after you get the first one working. That's what I'd do, anyway.
|
# ? Jun 9, 2022 22:17 |
|
I do have an option to use either USB or proper MIDI cable for input - and I reflectively assumed the former to be more hassle-free, but that's probably just PC habits. Though if you think about it, it's really just needlessly adding a middleman, isn't it?
|
# ? Jun 9, 2022 22:58 |
|
Lichtenstein posted:I do have an option to use either USB or proper MIDI cable for input - and I reflectively assumed the former to be more hassle-free, but that's probably just PC habits. Though if you think about it, it's really just needlessly adding a middleman, isn't it? Once you strip off all the USB stuff, the MIDI protocol over USB is (almost) exactly the same as the normal MIDI protocol. Many modern MIDI devices don't have a DIN-9 MIDI output jack, though: they only have USB. It's not silly to want to consider a USB in and a USB out. It's just that, for this application, I think you're going to have a much easier time if you start out with an old school MIDI jack, and then put a pre-built USB-MIDI adapter on it if you need one.
|
# ? Jun 10, 2022 00:12 |
|
It works! The coding part was admittedly dead easy compared to triple-checking how this stuff works on the hardware level, but no matter how basic, there's still a visceral thrill of loading up code and having it work on a first attempt.
|
# ? Jun 14, 2022 12:11 |
|
I'm sure somebody in here has experience wiring up WS2812B LEDs. I need to make a portable cylinder, 8-10 feet tall, with at least 4 runs of LEDs going down it. It needs to be packable, and not look awful. It's going to be used at a conference so it needs to stand up to some level of curious people touching it. I'm currently thinking of using a lighting stand with a custom-made metal triangle mounted on the top, then draping black polyester fabric down the sides to the legs of the stand, and running WS2812B strands down it. The triangle would need to mount on the holes at the top of the lighting stand. The Arduino and beefy PSU would get tied to the pole in the center with a bungee cord. This is pretty similar to your standard christmas tree lighting thing, except I need to provide the tree. I'm wondering if the combined expertise of the Arduino thread has enough experience making junk similar to this that they'd have some advice?
|
# ? Jul 7, 2022 23:55 |
|
whats the diameter
|
# ? Jul 8, 2022 00:06 |
|
shame on an IGA posted:whats the diameter I don't know yet, depends on how it's built. If I use the lighting tree, that's probably 3 feet diameter, maybe 4.
|
# ? Jul 8, 2022 00:12 |
|
A SK9822 or APA102 strip is easier to control. It has a separate clock line and uses normal SPI instead of a single data line that needs specific bit times
|
# ? Jul 8, 2022 00:17 |
|
Foxfire_ posted:A SK9822 or APA102 strip is easier to control. It has a separate clock line and uses normal SPI instead of a single data line that needs specific bit times Heh, okay. The code's already written though, I just need to build the structure
|
# ? Jul 8, 2022 00:18 |
|
Do you have mspaint scribble, or a picture of a standard christmas tree lighting thing? Hard to picture what you mean
|
# ? Jul 8, 2022 01:26 |
|
cruft posted:I'm sure somebody in here has experience wiring up WS2812B LEDs. I'm not sure what your question is? How to wire power? How to wire data? How to build it out of metal/plastic/wood/fiberglass?
|
# ? Jul 8, 2022 01:46 |
|
Foxfire_ posted:Do you have mspaint scribble, or a picture of a standard christmas tree lighting thing? Hard to picture what you mean Picture a tree trunk with strands of lights falling down it. Here's an ascii art version: pre:_____ | | | | | | | | | | | | | | | _____ babyeatingpsychopath posted:I'm not sure what your question is? How to wire power? How to wire data? How to build it out of metal/plastic/wood/fiberglass? Yeah, I didn't actually state what I need help with, sorry. I need advice on:
So far a light tree with fabric seems like the best idea I've had, but I'm really bad at physical design and maybe this is an awful idea. I'm hoping someone in this thread has done enough larger-scale designs that they have some advice. Maybe this isn't the right thread, either; I didn't find one that looked more appropriate, other than maybe cosplay. Thanks
|
# ? Jul 8, 2022 03:41 |
|
cruft posted:Picture a tree trunk with strands of lights falling down it. Here's an ascii art version: Start getting into conflicting goals here with the "fits in a suit case" and "hard to knock over". I'd probably lean to speaker stands with PVC that gets your strands to the desired height. Just make sure if you do anything to extend outward anywhere near the top that it's light materials so the center of balance stays towards the middle of the tripod.
|
# ? Jul 8, 2022 04:08 |
|
Yeah I think a speaker tripod would be sturdier bit I’m not sure how small it could get. Defining “suitcase” would help. Carryon size? Checked size? I’ve worked a ton with pixel strips for exhibit installations. I think the most important thing i can recommend for durability is to make sure your soldered ends are very secure. Because of how the pixel strips are made, the data line solder joint is extremely susceptible to breaking. Make sure the last inch or more is secured so it cannot wiggle at all, and do the same for your wire. If at all possible, try and stick with 20 or 22 AWG wire for your connections. 18 awg, while better for power concerns, tends to be stiff enough that it will rip pads right off if you flex it wrong. The copper used in most pixel strips Ive handled seem more brittle than typical rgb or white strips. Maybe its just thin. I sometimes will do a splice for the last 3 inches of the wire run using 18 awg. I then go to smaller for the connection. Its not electrically ideal but it seems better than pumping 5-10 amps of 5V over 8ft runs of smaller gauge.
|
# ? Jul 8, 2022 13:26 |
|
I feel like an idiot for not thinking of this right away. Building a rectangular prism out of PVC seems like the obvious solution. Built on its side and then erected, PVC should pack up pretty nicely. I can get some sort of thick plastic bags to fill with water once we've arrived, and use those to weigh it down. Maybe throw in some nylon rope to use as guy wires to keep it rigid. pre:_______________________________ -/ -/ -/ - / - / - / -______________-__/___________- / / - / - / - / - / - / - /-_____________/-_____________/- Thanks!
|
# ? Jul 8, 2022 16:49 |
|
No clue what your budget is, but there are piles of pop-up pavilions and displays and whatnot for trade shows that you could take inspiration from or buy. As far as durability: good connectors, plenty of strain relief, and as much potting and mechanical control as you can get for the wires near any connection points. I have a few spools of 22ga silicone wire that i use for all my hookups, crimped into JST connectors. 2-3" of wire, soldered onto the pad, then covered in epoxy. then zip-tie the epoxy blob to the structure. then wrap the whole thing in tape so only the connector is exposed. Then, when something inevitably catches on the wire, the connector unplugs or the wire tears out of the crimp before managing to use up all of the crash structure that is zip ties wrapped in tape.
|
# ? Jul 9, 2022 00:31 |
|
yeah if you've got decent budget for this I would suggest using M12 connectors and multistrand industrial sensor cable for all your breakdown connections. As for the mechanics, woodworking or blacksmithing threads will probably have good input if you ask there
|
# ? Jul 9, 2022 00:58 |
|
So, I have a question regarding programming the fuses/bootloader etc of ATMEGA chips. I want to be able to run them without a crystal... I've heard that the internal crystal sucks. What really are the ramifications of this? Like, I won't be able to listen to the chip in Serial monitor? I have to default to a slower baud rate? I won't be able to program it anymore? Everything on these chips uses Serial doesn't it, even ICSP? Do I need a USBASP? Is it (or an Arduino) absolutely needed to program the fuses and eeprom directly? Can it be done with an FTDI usb->serial adapter? if so, how difficult is it? should I just save the headache and buy the thing? Is it needed if I get a bunch of ATMEGA variants? like the ATTINY? I had aquired a smattering of different AT-chips For context, I have an arduino, a Duecimilanove and some esp32s along with a couple of serial boards (FTDI and such). This kind of thing would all be done with ICSP right? Sorry if this is poorly organized, but I did a bunch of research a few months ago but then had to drop it and I'm trying to have a quicker start this time. Thanks!
|
# ? Jul 11, 2022 20:59 |
|
namlosh posted:So, I have a question regarding programming the fuses/bootloader etc of ATMEGA chips. You can't run the chip without some sort of clock. The default fuse settings use an internal RC oscillator, which is not crystal-based -- it's a little ball of resistors and capacitors that produce a sine wave when powered. Fiddling with the fuses is done when you want to run the chip off an externally connected crystal oscillator, the clock-out pin of another microcontroller, or the like. Most (all?) arduinos have a crystal oscillator on the board and are pre-fused to use it, but "naked" atmega chips out of the box won't be. Don't know about the programming aspect, but I suspect that even for an arduino you'll need an external programmer (although if you have a spare usb-programmable board like an arduino lying around you can turn it into the programmer and use it to re-fuse the rest, IIRC).
|
# ? Jul 11, 2022 22:15 |
|
The internal RC oscillator will be less stable and less accurate than a crystal. e.g. an ATMega8U2's internal RC is nominally 8Mhz @ 25C and factory calibrated to be within +/-10% of that. Even a very crappy $0.15 8MHz crystal will have an accuracy specification of something like 50ppm (0.005%). The RC will also jitter more cycle-to-cycle, shift more with temperature changes, and drift more over time. (The internal one is a resistor and capacitor formed out of semiconductor just like the rest of the IC so it's basically free. An external crystal is a block of quartz physically cut to have a specific resonant frequency. It isn't straightforward to package that into the same chip) If you did something like set up a UART for nominally 115200 baud then measured the actual bit rate, you'd see something higher or lower depending on how far off the oscillator was from nominal. Whether another device can successfully talk to that will depend on how much tolerance it has for clock recovery. Or if you were doing something like playing an audio file where you are ideally producing DAC samples at some fixed sampling rate, a 10% error in the clock would be audible as shifted pitches. For programming/debugging, an ATMega has a few interfaces. You are probably using the serial programming one that uses a couple SPI-like pins and can program flash and most fuses. It can't change all possible fuses (e.g. you can't disable serial programming using it). It also doesn't support debugging stuff like breakpoints or single stepping instructions. For hobby stuff, you probably aren't going to need to change most fuses, so if you don't care about debug features, it probably doesn't matter to you whether you are using serial programming or debugWire
|
# ? Jul 11, 2022 22:19 |
|
You can use one of the many ICSP programmers (USBtiny, AVR MKII etc) or another Arduino as the ICSP (search "Arduino as ISP") to set the fuses for using the internal oscillator and to burn the bootloader that will then allow you to upload sketches via a typical FTDI USB-serial adapter. I regularly build devices using the internal 8MHz oscillator on the ATmega328p, and the main concession is that I use 57600 baud for serial communications instead of the Arduino default 115200, because I'd occasionally get errors at 115200. Besides that I haven't had any issues with my typical set of peripherals like microSD cards, various sensors, real time clocks etc, since those are all running on some slower protocol (I2C, SPI) that can work within the lower overall 8MHz clock speed. But none of my applications require very fast and tight timing. I generally set up new chips by putting the Optiboot bootloader https://github.com/Optiboot/optiboot on, which has options for setting fuses at 8MHz on the internal oscillator when you burn the bootloader.
|
# ? Jul 12, 2022 04:49 |
|
Rat Poisson posted:You can use one of the many ICSP programmers (USBtiny, AVR MKII etc) or another Arduino as the ICSP (search "Arduino as ISP") to set the fuses for using the internal oscillator and to burn the bootloader that will then allow you to upload sketches via a typical FTDI USB-serial adapter. I do the same thing. I've got a box of 328pu's and an ancient uno that's permanently wired as an ICSP with a socket on a breadboard. 8MHz is fine for most stuff as long as you're not doing audio.
|
# ? Jul 12, 2022 14:11 |
|
This is awesome, thx for the replies. I’m going to do some experimentation tonight and get back. It turns out that I have one of these: https://www.amazon.com/gp/aw/d/B01CZVZ1XM USBTINYISP I assume I can use it via avrdude to program the boot loader and fuses of most of the AT chips. The big thing I want to address first is to reprogram the correct arduino duecimilanove boot loader onto that boards chip. I think I borked the boot loader on that board accidentally from my Macbook by getting too aggressive with the upload button in the arduino IDE. It won’t do anything at the moment via usb, so I’m going to try to fix it using ICSP next.
|
# ? Jul 12, 2022 15:30 |
|
namlosh posted:getting too aggressive with the upload button in the arduino IDE it's the only way they'll learn!
|
# ? Jul 12, 2022 18:11 |
|
That’s what I thought! Lol But evidently pushing it in macOS or Linux can cause it to overwrite the boot loader with crap…
|
# ? Jul 12, 2022 18:57 |
|
That's hilarious. Luckily, I think you can always recover it with the ICSP pins unless you set the fuses to lock the chip.
|
# ? Jul 12, 2022 19:46 |
|
namlosh posted:That’s what I thought! Lol Not entirely sure what you mean but I've set fuses / programmed dozens of Atmel chips with avrdude from Linux using that same type of USB programmer, and I've never had a problem. So I sort of doubt the operating system is the issue. E: I guess I ought to point out that if you're doing things at this level, you might be ready to stop using the Arduino IDE / bootloader, and just run gcc and avrdude yourself. It'll free up some space in the memory of the chip that would otherwise be taken by the bootloader. EE: unless you're trying to update the firmware on your USBTiny? Sorry for the spam if that's the case. Brain's still fuzzy from COVID. cruft fucked around with this message at 19:58 on Jul 12, 2022 |
# ? Jul 12, 2022 19:52 |
|
cruft posted:Not entirely sure what you mean but I've set fuses / programmed dozens of Atmel chips with avrdude from Linux using that same type of USB programmer, and I've never had a problem. So I sort of doubt the operating system is the issue. Dang I can’t find it now, but there was a support article or post on the arduino forums or something stating that Linux and MacOS could overwrite the boot loader if you hit the upload button a couple of times before it could finish. It’s possible it was only an issue with the old rear end Duecimilanove I have. Either way I broke it and was trying to get it working again. And good point… I’m actually using platformio for things now but go back to arduino ide for some stuff because there’s just so much more support and I can copy the command line args it generates to use as a template Speaking of which, someone mentioned a plug-in for Visual Studio (not vscode) for working with microcontrollers? I like vscode and all, but have enterprise MSDN so thought I’d see if there was anything to be gained… plus it would help to not have to remember different keyboard shortcuts
|
# ? Jul 12, 2022 20:28 |
|
Ah, thats Visual Micro. Its pretty good! They have a full feature trial, but you have to buy it eventually. Pretty reasonable price though. Im pretty stupid but it works great for me.
|
# ? Jul 13, 2022 05:16 |
|
Fanged Lawn Wormy posted:Ah, thats Visual Micro. Its pretty good! They have a full feature trial, but you have to buy it eventually. Pretty reasonable price though. ”visual micro website” posted:Debug your ESP32/8266/NINA WiFi project remotely so you can debug your project in its real environment, from the comfort of your PC Is that true? Have you used it? That seems like it would be a killer app for me
|
# ? Jul 13, 2022 12:55 |
|
|
# ? May 29, 2024 15:20 |
|
I have not - I tend to avoid wireless. but I believe it! The debug console and graphs are nice. Contact the dev or ask on their forums, Ive found they are nice folks.
|
# ? Jul 13, 2022 19:20 |