随着所有RetroPie / Raspberry Pi Arcades的建造,我决定尝试使用Raspberry Pi 3中的一个 - 但我希望我的有点不同。
我从来没有真正关心暴露Pi上的端口以插入电源/视频/ USB,所以我使用了直通端口。
我也没有包括一个屏幕,因为它被设计为插入电视/显示器,我真的没有空间在我家里甚至一个半尺寸的街机。
有一个内部的声音激励器,可以在HDMI和内部声音/耳机输出之间切换,还有一个电位计来控制激励器音量。
由于网上有很多项目描述按钮和操作系统设置,我只会告诉你我还有什么不同的做法。
SparkFun的Teensy LC微控制器板控制电源电路。
当按下电源按钮时,监视它的Teensy LC激活一个继电器,该继电器控制Raspberry Pi的电源,然后打开它。
Raspberry Pi然后向微控制器发送一个高信号,指示它已通电,Teensy转动按钮并将LED指示灯亮起。
当再次按下电源按钮关闭Pi时,Teensy向Pi发送信号,Pi开始关机过程。
一旦操作系统完全关闭,Teensy就会关闭继电器 - 完全关闭Pi并关闭灯。
只要机器插上电源,Teensy就会通电,但功耗很小,所以我不太担心它。
盒子的盖子上还有一个小红色LED指示它已插入。
盒子背面有声音电位器开关,外接扬声器/耳机插孔,电源桶连接器,microSD卡插槽,HDMI连接和两个USB端口。
一个USB端口通过Raspberry Pi USB端口,因此我可以连接闪存驱动器,附加控制器等。另一个USB端口连接到Teensy,如果我想更改照明而不必打开,我可以重新编程
框。
侧面有两个通风孔,可以让气流活跃起来,看起来非常酷。
外部microSD卡插槽通过microSD卡扩展器电缆连接到Pi。
端口上的标签贴花是使用Cricut制作机器创建的。
以前版本的盒子在封面和侧面都有游戏艺术品,但对于最终版本,我真的很喜欢带有按钮发光的纯黑色外观。
按钮是Adafruit的清晰街机按钮。
他们觉得我有点海绵,所以我给每个人增加了一个额外的弹簧,给他们一个很好的坚实感觉。
由于我使用了清晰的按钮,我在每个按钮周围添加了一条6个Neopixels,以增加灯光效果。
由于每个LED都是可单独寻址的RGB,因此我可以在每个按钮上创建许多不同的灯光效果,包括多个颜色。
目前,按钮根据被仿真的系统点亮 - 只有两个按钮点亮NES,所有六个按钮用于SNES(彩色以匹配原始控制器),一个用于Daphne等。这是通过编写一个小python脚本来完成的。
读取活动系统并使用自定义3通道1位接口(我已指定“DragonSpeech”,因为,为什么不?)将信息传递给Teensy。
由于空心轴内的迷你Neopixel和来自www.paradisearcadeshop.com的球,操纵杆也会亮起。
在系统通电但没有玩游戏时,还会发生一些其他随机照明效果。
这些按钮非常适合街机游戏,但我也有一个通过蓝牙和USB游戏手柄连接的PlayStation 3控制器来玩控制台游戏。
有一个小的加密狗插入Pi,所以我可以使用无线键盘和鼠标,这使我可以玩DOS游戏,并与终端一起工作,无需打开盒子或占用一个外部USB端口。
USB端口非常便于插入闪存驱动器和传输文件,或插入额外的USB控制器。
我使用带状电缆和矩形连接器连接到盖子上的所有东西,因此它可以轻松拆卸。
拆开盖子进行更改和修复要容易得多。
街机摇杆和所有外部按钮都是通过Pi的GPIO使用Adafruit优秀的Pocket PiGRRL教程直接设置的。
每个按钮还有一些额外的电线连接到Teensy,它们将它们作为中断进行监控,并在按下时将每个按钮闪烁为白色。
这是拆下盖子的盒子。
布线相当混乱,但空间很紧,我最终会回来清理它。
☺
这个版本中的很多东西都是矫枉过正的,并且可以构建更便宜的RetroPie游戏机,但它也是一种学习体验。
我有很多乐趣添加组件并弄清楚如何使所有内容协同工作。
以上来自于谷歌翻译
以下为原文
With all the RetroPie/Raspberry Pi Arcades being built, I decided I would try my hand at one from a Raspberry Pi 3 – but I wanted mine to be a little different. I’ve never really cared for exposing the ports on the Pi in order to plug in power/video/USB, so I used pass-through ports. I also didn’t include a screen, as it’s designed to be plugged into a TV/monitor, and I really don’t have room for even a ½ size arcade machine in my house. There is an internal exciter for sound with a switch to change between HDMI and internal sound/headphones output, and a potentiometer to control the exciter volume. Since there are plenty of projects online describing button and OS setup, I’ll just tell you what else I did differently.
A Teensy LC microcontroller board from SparkFun controls the power circuit. When the power button is pressed, the Teensy LC that monitors it activates a relay which controls power to the Raspberry Pi, turning it on. The Raspberry Pi then sends a high signal to the microcontroller to indicate it’s powered up and the Teensy turns the button and stick LEDs on. When the power button is pressed again to turn the Pi off, the Teensy sends a signal to the Pi and the Pi begins the shutdown process. Once the OS is completely shut down, the Teensy deactivates the relay – turning the Pi off completely and shutting down the lights. The Teensy is powered as long as the machine is plugged in, but the power draw is minimal so I’m not too worried about it. There’s also a small red LED on the cover of the box to indicate that it’s plugged in.
The back of the box has the potentiometer switch for sound, external speaker/headphone jack, a barrel connector for power, microSD card slot, HDMI connection, and two USB ports. One USB port passes through to the Raspberry Pi USB port so I can connect a flash drive, additional controllers, etc. The other USB port connects to the Teensy, allowing me to reprogram it if I want to change the lighting without having to open the box. Two vents on the side allow airflow, and look pretty cool with the lights active. The exterior microSD card slot is connected to the Pi via a microSD card extender cable.
The label decals over the ports were created using a Cricut crafting machine. Previous versions of the box had gaming artwork on the cover and sides, but for the final version I really liked the plain black look with the glow of the buttons.
The buttons are clear arcade buttons from Adafruit. They felt a bit spongy to me, so I added an additional spring to each one which gives them a nice solid feel. And since I was using clear buttons, I added a strip of 6 Neopixels around each button to add lighting effects. Since every led is individually addressable and RGB, I can create many different lighting effects on each individual button, including multiple colors on one. Currently, the buttons light up according to the system being emulated – only two buttons lit up for NES, all six for SNES (colored to match the original controller), one for Daphne, etc. This was done by writing a small python script to read the active system and pass the info to the Teensy using a custom 3-channel 1-bit interface (which I have designated “DragonSpeech” because, why not?). The joystick also lights up thanks to a mini Neopixel inside a hollow shaft and ball from www.paradisearcadeshop.com. There are also a couple of other random lighting effects that occur while the system is powered up but no game is being played.
The buttons are great for arcade games, but I also have a PlayStation 3 controller that is connected via Bluetooth and a USB gamepad to play console games. There is a small dongle plugged into the Pi so I can use a wireless keyboard and mouse, which allows me to play DOS games and work with the terminal without opening up the box or occupying the one external USB port. The USB port is really handy for plugging in a flash drive and transferring files, or plugging in an extra USB controller.
I used a ribbon cable and rectangular connectors to make the connection to everything on the cover so it’s easily removable. It’s much easier to make changes and fixes with the cover detached. The arcade stick and all external buttons were set up directly through the Pi’s GPIO using Adafruit’s excellent Pocket PiGRRL tutorial. There’s also additional wires from each button to the Teensy, which monitors them as interrupts and flashes each button white as it is pressed.
This is the box with the cover removed. The wiring is pretty messy, but space is tight and I’ll get back to clean it up eventually. ☺
A lot of things in this build are overkill and there are much less expensive RetroPie gaming machines that can be built, but it was also a learning experience. I had a lot of fun adding components and figuring out how to make everything work together.
|