Category Archives: python

A Raspberry Pi Rain Man in the Making

We see a lot of Raspberry Pis used to play games, but this is something entirely different from the latest RetroPie build. This Raspberry Pi is learning how to read playing cards, with the goal of becoming the ultimate card counting blackjack player.

If [Taxi-guy] hasn’t named his project Rain Man, we humbly suggest that he does so. Because a Pi that can count into a six-deck shoe would be quite a thing, even though it would never be allowed anywhere near a casino. Hurdle number one in counting cards is reading them, and [Taxi-guy] has done a solid job …read more

Continue reading

Posted in blackjack, cards, casino, misc hacks, opencv, PiCam, playing cards, python, rank, Raspberry Pi, suit, table games | Leave a comment

Emulate ICs in Python

Most people who want to simulate logic ICs will use Verilog, VHDL, or System Verilog. Not [hsoft]. He wanted to use Python, and wrote a simple Python framework for doing just that. You can find the code on GitHub, and there is an ASCII video that won’t embed here at Hackaday, but which you can view at ASCIInema.

Below the break we have an example of “constructing” a circuit in Python using ICemu:

dec = SN74HC138() sr1 = CD74AC164() sr2 = CD74AC164() mcu_pin = OutputPin('PB4') sr1.pin_CP.wire_to(dec.pin_Y0) sr2.pin_CP.wire_to(dec.pin_Y1) sr1.pin_DS1.wire_to(mcu_pin) sr2.pin_DS1.wire_to(mcu_pin) print(dec.asciiart()) _______ A>|- U +|>Y7 B>|- +|>Y6 C>|- +|>Y5 G2A>|- +|>Y4 

…read more

Continue reading

Posted in circuit simulation, emulation, Logic simulation, python, simulation, software hacks | Leave a comment

Cheap And Easy Motion Tracking

[Koppany Horvarth] set out to create a dirt-cheap optical tracking rig for VR that uses only two cameras and a certain amount of math to do its thing. He knew he could do theoretically, and wouldn’t cost a lot of money, but still required a lot of work and slightly absurd amount of math.

While playing around with a webcam that he’d set up to run an object-tracking Python script and discovered that his setup tended to display a translucent object with a LED inside of it as pure, washed-out white. This gave [Koppany] the idea that he could use …read more

Continue reading

Posted in motion tracking, python, Virtual Reality, webcam motion detector | Leave a comment

Remote Controlled Streaming Speakers

For want of a better use of a spare Raspberry Pi Zero W and a set of LogitechZ-680 surround sound speakers, [Andre van Kammen] hacked them together to make them stream music playing from his phone.

It was stumbling across the Pi Music Box distribution that really got the ball rolling, and the purchase of a pHAT DAC laid the foundation. Cracking open the speakers’ controller case, [Kammen] was able to get 5V of power off some terminals even when the speakers were on standby — awesome! — which the Pi could use. Power and volume are controlled via the …read more

Continue reading

Posted in c++, logitech, mopidy, musical hacks, pHAT DAC, python, Raspberry Pi, speakers, zero | Leave a comment

DIY Wireless Sprinkler System? Don’t Mind If I Do.

What to do once you have a sprinkler system installed on your property: buy a sprinkler control system or make your own? The latter, obviously.

[danaman] was determined to hack together a cheap, IoT-enabled system but it wasn’t easy — taking the better part of a year to get working. Instead of starting right from scratch, he used the open-source Sustainable Irrigation Platform(SIP) control software — a Python sprinkler scheduler with some features [danman] was looking for(eg: it won’t activate if there’s rain in the forecast). Since he wasn’t running it with a Raspberry Pi as recommended, [danman] wrote a …read more

Continue reading

Posted in ESP8266, home hacks, IoT, python, SIP, sprinkler, wifi, wireless, wireless hacks | Leave a comment

We Should Stop Here, It’s Bat Country!

[Roland Meertens] has a bat detector, or rather, he has a device that can record ultrasound – the type of sound that bats use to echolocate. What he wants is a bat detector. When he discovered bats living behind his house, he set to work creating a program that would use his recorder to detect when bats were around.

[Roland]’s workflow consists of breaking up a recording from his backyard into one second clips, loading them in to a Python program and running some machine learning code to determine whether the clip is a recording of a bat or not …read more

Continue reading

Posted in bat detector, bats, digital audio hacks, keras, machine learning, python, tensorflow | Leave a comment

Australian Raspberry Pi Tutorials

There’s a new and very detailed video tutorial about the Raspberry Pi available from the Australian firm Core Electronics.  There are 30 videos and 5 chapters in total. A few of the introduction videos are short, but the detail videos range from 3 to 16 minutes.

The instructor [Michael] starts out at the very beginning — loading NOOBS on the Pi — and then moves on to Python, shell scripting, and building GUI applications with TkInter. It also covers using Particle Pi for IoT applications that integrate with IFTTT.

We do realize that most people reading Hackaday have probably used …read more

Continue reading

Posted in python, Raspberry Pi, tkinter, tutorial | Leave a comment

Building A K9 Toy

[James West] has a young Doctor Who fan in the house and wanted to build something that could be played with without worrying about it being bumped and scratched. So, instead of creating a replica, [James] built a simple remote controlled K9 toy for his young fan.

K9 was a companion of the fourth Doctor (played by Tom Baker) in the classic Doctor Who series. He also appeared in several spin-offs. A robotic dog with the infinite knowledge of the TARDIS at hand, as well as a laser, K9 became a favorite among Who fans, especially younger children. [James] wanted …read more

Continue reading

Posted in Doctor Who, k9, python, Raspberry Pi, Raspberry Pi Zero, robots hacks, wiimote | Leave a comment

Controlling a Robot Over the Internet Grows Up

Since the beginning of the Internet people have been controlling robots over it, peering at grainy gifs of faraway rec rooms as the robot trundles around. RunMyRobot.com has taken that idea and brought it fully into the teens. These robots use wifi or mobile connections, are 3D printed, and run Python.

The site aims to provide everything to anyone who wants to participate. If you’re just an anonymous visitor, you can still play with the robots, but anyone can also play with the same one, and sometimes a whole bunch of visitors create a cacophony of commands that makes it …read more

Continue reading

Posted in internet hacks, python, robots, robots hacks, webcam | Leave a comment

Ask Hackaday: How Do You Python?

Python is the Arduino of software projects. It has a critical mass of libraries for anything from facial recognition and neural networks to robotics and remote sensing. And just like Arduino, I have yet to find the killer IDE for Python. Perhaps I just haven’t tried the right one yet, but it could be that I’m just doing Python wrong.

For Years I’ve Been IDLE

I’m a Linux-only type of a guy so using IDLE for Python is a natural fit. It’s in the repositories for super quick and easy install and there’s basically zero configuration to be done. Generally …read more

Continue reading

Posted in Ask Hackaday, atom, code completion, Geany, ide, IDLE, interactive shell, Interest, python, Software Development | Leave a comment