A robot that uses CV to detect villagers in Stardew Valley and display their gift preferences on a screen.

Stardew Valley Preferences Bot Is A Gift To The Player

It seems like most narrative games have some kind of drudgery built in. You know, some tedious and repetitious task that you absolutely must do if you want to succeed. In Stardew Valley, that thing is gift giving, which earns you friendship points just like in real life. More important than the giving itself is that each villager has preferences — things they love, like, and hate to receive as gifts. It’s a lot to remember, and most people don’t bother trying and just look it up in the wiki. Well, except for Abigail, who seems to like certain gemstones so much that she must be eating them. She’s hard to forget.

[kutluhan_aktar]’s villager gift preferences bot is a fun and fantastic use of OpenCV. This bot uses a LattePanda Alpha 864s, which is a single-board computer with an Arduino Leonardo built in. It works using template matching, which is basically a game of Where’s Waldo? for computers.

Given a screenshot of each villager in various positions, the LattePanda recognizes them among a given game scene, then does a lookup of their birthday and preferences which the Leonardo prints on a 3.5″ LCD screen. At the same time, it alerts the player with a buzz and big green LED. Be sure to check it out in action after the break.

In Animal Crossing, the drudgery amounts to pressing the A button while catching shooting stars. That’s not a huge problem for a Teensy.

Continue reading Stardew Valley Preferences Bot Is A Gift To The Player”

Low-Cost Computer Gesture Control With An I2C Sensor

Controlling your computer with a wave of the hand seems like something from science fiction, and for good reason. From Minority Report to Iron Man, we’ve seen plenty of famous actors controlling their high-tech computer systems by wildly gesticulating in the air. Meanwhile, we’re all stuck using keyboards and mice like a bunch of chumps.

But it doesn’t have to be that way. As [Norbert Zare] demonstrates in his latest project, you can actually achieve some fairly impressive gesture control on your computer using a $10 USD PAJ7620U2 sensor. Well not just the sensor, of course. You need some way to convert the output from the I2C-enabled sensor into something your computer will understand, which is where the microcontroller comes in.

Looking through the provided source code, you can see just how easy it is to talk to the PAJ7620U2. With nothing more exotic than a switch case statement, [Norbert] is able to pick up on the gesture flags coming from the sensor. From there, it’s just a matter of using the Arduino Keyboard library to fire off the appropriate keycodes. If you’re looking to recreate this we’d go with a microcontroller that supports native USB, but technically this could be done on pretty much any Arduino. In fact, in this case he’s actually using the ATtiny85-based Digispark.

This actually isn’t the first time we’ve seen somebody use a similar sensor to pull off low-cost gesture control, but so far, none of these projects have really taken off. It seems like it works well enough in the video after the break, but looks can be deceiving. Have any Hackaday readers actually tried to use one of these modules for their day-to-day futuristic computing?

Continue reading “Low-Cost Computer Gesture Control With An I2C Sensor”

Arduino Piano Tuner Is Pitch Perfect

[JanHerman] knows that tuning musical instruments is all about precision and that precision is measured in a logarithmic unit called a cent. A cheap tuner unit might be accurate to 1.5 cents which sounds good until you look at one for ten times the price and find it is accurate to 0.1 cents. So you can spend $800 for precision or $60 for something less. [Jan] decided to build something better and cheaper using a 32-bit Arduino and a DDS frequency generator chip on a breakout board.

Oddly enough, the device doesn’t have a display. Instead, it generates a precise frequency and couples it to the piano using a transducer. You tune the string to the corresponding note. The post has a lot of detail about how piano tuning works.

Continue reading “Arduino Piano Tuner Is Pitch Perfect”

Visualizing Audio With An LCD VU Meter

We all love seeing data represented in pretty ways — whether it’s necessary or not. Take VU meters for example. They’re a super useful tool for audio editors to balance signals, but they also look really cool, even if you’re only listening to music. Who didn’t use a Winamp skin with a built-in VU meter back in the day? Even after the demise of everyone’s favorite media player, we still see these great graphs popping up all over the place.

Most recently, we’ve seen VU meters circle back around to have a bit of a retro vibe in this awesome Arduino-controlled LCD VU meter built by [mircemk]. Based on the KTAudio VU Meter project, it features an ultra-wide LCD, audio input, and volume knob, all tidily wrapped up in a case whose color scheme that can only conjure images of the famed Altair 8800, or an old Tektronix oscilloscope. The LCD itself is fairly responsive — but you can judge for yourself in the video below. The signature fading that so commonly accompanies screen refreshes on LCDs such as this one really adds to the retro effect.

You may just need one of these displays on your desk — after all, while you may not need to know how loud each audio channel is, don’t you at least want the information available? Just in case. Bar graph display a bit too modern-looking for you? Well then you should check out [mircemk]’s OLED version that displays dual analog meters.

Continue reading “Visualizing Audio With An LCD VU Meter”

Adafruit AVRProg Grows UPDI Interface Support

Making a small number of things with an embedded application is pretty straightforward, you usually simply plug in a programmer or debugger dongle (such as an AVRISP2) into your board with an appropriate adaptor cable, load your code into whatever IDE tool is appropriate for the device and hit the program button. But when you scale up a bit to hundreds or thousands of units, this way of working just won’t cut it. Add in any functional or defect-oriented testing you need, and you’re going to need a custom programming rig.

Adafruit have a fair bit of experience with building embedded boards and dealing with the appropriate testing and programming, and now they’ve updated their AVR Programming library to support the latest devices which have moved to the UPDI (Unified Programming and Debug Interface) programming interface. UPDI is a single-wire bidirectional asynchronous serial interface which enables programming and debugging of embedded applications on slew of the new AVR branded devices from Microchip. An example would be the AVR128DAxx which this scribe has been tinkering with lately because it is cheap, has excellent capacitive touch support, and is available in a prototype-friendly 28-pin SOIC package, making it easy peasy to solder.

The library is intended for use with the Arduino platform, so it should run on a vast array of hardware, without any special requirements, so making a custom programming jig out of hardware lots of us have lying around is not a huge hassle.

Adafruit provide a few application examples in the project GitHub to get you going, such as this ATTiny817 example that wipes the flash memory, sets appropriate fuses and drops in a bootloader.

The UPDI code was taken from the [brandanlane’s] portaprog which is hosted on the TTGO T-Display ESP32 board from Chinese outfit LilyGo, which is also worth checking out.

A little while ago we saw how the AVR Multitool, the AVRGPP learned to speak UPDI, and since we’re on programming interfaces, its possible to get the cheap-as-chips USBasp to speak TPI as well.

Continue reading “Adafruit AVRProg Grows UPDI Interface Support”

Groovin’ With A Gesture-Controlled MP3 Player

Touchscreens are great, but they’re not always the perfect solution. Trying to operate one with gloves on (even alleged “touchscreen-friendly” ones) can be cumbersome at best, and if the screen is on a publicly-shared device, such as a checkout kiosk it can easily become a home for bacteria, viruses and all sorts of other nasty stuff.

That’s what [Norbert Zare] was thinking when he built his gesture-controlled MP3 player. It uses a PAJ7620U2 gesture sensor to register a few intuitive hand motions including finger twirls to control the volume, hand swipes to skip forward and backwards, and a flat hand to play and pause the song. It even has a motorized knob and cute cutout music notes that move to provide some visual feedback for the gestures, which you can see in-action in the video below. If this seems familiar, it’s because on Tuesday we took a look at the camera-based, glance-to-skip-tracks controller he built.

To actually play some music, he gutted an old MP3 player and hooked the solder pads from the control buttons up to an Arduino, which reads gesture information from the sensor and emulates the MP3 player’s buttons by setting the appropriate pins to HIGH and LOW. Finally, he topped the whole thing off with an LCD screen and a case.

The great thing about [Norbert]’s approach is that it isn’t just limited to an MP3 player — it can be extended to replace the buttons on pretty much any device. Because the Arduino only needs to be connected to the button inputs of the device, it should be relatively easy to adapt most existing tactile interfaces to be touch-free. Paired with this gesture-tracking macro keyboard we saw earlier in the year, the days of actually having to touch our tech may soon be behind us.

Continue reading “Groovin’ With A Gesture-Controlled MP3 Player”

Fake motivational plant squirts you in the wherever.

Focus Flower Motivates By Squirting Water In Your Face

When you need to get some tasks done and are short on attention, it’s hard to beat a timer. But whenever you do, it feels pretty darn good. The problem is that when you don’t finish in time, what’s the punishment? There are no consequences baked into the Pomodoro Technique other than good ol’ guilt. Wouldn’t it be better if there was a bit of negative reinforcement involved?

[Hardware Unknown]’s Focus Flower never needs watering, at least not in the normal horticultural way. You will have to fill a reservoir, because this flower provides liquid motivation. No, it’s not a spirit spritzer, though we suppose you could turn it into an avant-garde vodka fountain when the novelty of water wears off, making this Pomodoro with a twist into more of a Bloody Mary. It’s a natural next step, especially if you were already into the hot sauce idea.

Operation Focus Flower is simple: just push the easy button to start the task timer, and the Arduino Nano attached will begin a countdown. Push the button again when you’re done, but if you don’t do it before the countdown is over, the plant squirts you with a steady, skin-blasting stream of water from a solenoid-driven flosser tip. An air compressor nearby is required, which blows the minimalist vibe a bit, but you could always stow that part underneath your desk.

The Focus Flower sure looks to be effective at the whole negative reinforcement thing. And it doesn’t leave you totally clueless — there’s a ring of LEDs around the base that show how much time is left. Whenever you do successfully hit the button in time, it will say ‘that was easy’ in one of 12 languages, hence all the flags. Do not miss the totally free infomercial below.

Maybe you want a more friendly way to manage your time — we understand. Meet the Pomodachi productivity pet.

Continue reading “Focus Flower Motivates By Squirting Water In Your Face”