按下按钮可以显示自定义单词 [英] Hook up buttons to display custom words when pressed

查看:112
本文介绍了按下按钮可以显示自定义单词的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一些背景信息:我做了一个圣诞灯光表演,一个闪烁的音乐。今年我将有一个自动点唱机,客人可以按一个按钮,然后歌曲将播放。将有13个按钮分别连接到称为输入小狗的设备。这是制作圣诞灯控制器的公司的一块硬件。



我的问题:在这些按钮上,我想要一根电线连接到树莓pi或arduino,某种东西。按下按钮它将显示在屏幕上当前歌曲是SONG NAME即将播放的歌曲是SONG NAME



如果没有符合歌曲的话,它会可以读到类似当前歌曲是歌曲名称。下一首歌没有选择播放。



我怎么能做到这一点?这就是我认为我知道的到目前为止。我需要一个覆盆子pi,以及将13个按钮连接到pi的东西.pi需要运行一个脚本,告诉它何时按下按钮1,显示相应的歌曲。以及脚本中的某个地方,它需要像阙一样,所以如果有人按下4个按钮,屏幕上会显示所有4首歌曲都在下一行播放。



我想非常清楚,这实际上并不是控制灯光,音乐,甚至是为它播放信号。这只是为了显示目的,所以客人知道什么歌曲在里面。



最后一个想法;我猜c ode将需要包括歌曲的时间,否则,它将如何知道是时候显示下一首歌曲。所以我想它应该是这样的,当按下按钮一时(假设已经播放了当前的歌曲),显示下一首歌是钟声的卡罗尔200秒。



如果当前没有播放的歌曲(意思是之前没有按任何一个按钮)并且接下来没有播放的歌曲,则该文本应该显示为没有选择歌曲。请制作你的选择如下。



我尝试过:



please请参阅上面的以下文字,了解我对该项目的了解。

Some background info: I do a Christmas Light show, one where it blinks to the music. This year I am going to be having a "jukebox" where a guest can press a button, and then the song will play. There will be 13 buttons individually hooked up to a device called an "Input pup." That is a piece of hardware from the company that makes the Christmas light controllers.

My question: On these buttons, I want to also have a wire going to a raspberry pi or arduino, something of that sort. When you press the button It would display on a screen "The current song is SONG NAME The Upcoming song is SONG NAME"

If there is no song in line, it could read something like "The Current Song is SONG NAME. There is no song selected to play next.

How can I accomplish this? This is what I think I know so far. I will need a raspberry pi, and something to connect the 13 buttons to the pi with. The pi will need to be running a script that tells it when button 1 is pressed, display the corresponding song. and somewhere in the script, it will need to act like a que, so if someone pressing 4 buttons, on the screen it will show all 4 songs are in line to be played next.

I want to be very clear that this WILL NOT BE actually controlling the lights, music, or even sending a signal for it to be played. This is for display purposes only so guests know what songs are in que.

One final thought; I guess the code will need to include the timing of the song, otherwise, how will it know that it's time to display the next song in line. So I guess it should be something like, when button one is pressed (providing there is a current song already playing), display the words "The next song is Carol of the bells for 200 seconds."

If there is no song currently playing (meaning no one pressed a button previously) AND there is no song to be played next, then the text should read something like "There are no songs selected. Please make your selection below."

What I have tried:

please see the following text above for what I know about this project.

推荐答案

您必须将按钮连接到Rapsberry Pi的GPIO端口。如何做到这一点取决于输入小狗硬件使用的信号电平。当按钮也连接到其他harwdare(您的灯光控制器)时,您通常必须使用电平转换器来保护Raspberry Pi输入免受灯光控制器电压的影响,反之亦然。



要对GPIO输入变化作出反应,您可以使用 WiringPi [ ^ ]。它提供了库和命令行工具来配置GPIO端口并进行输入和输出。



对于软件,您必须决定使用哪种编程或脚本语言以及如何从音乐队列中获取信息。
You have to connect the buttons to the GPIO ports of the Rapsberry Pi. How this can be done depends on which signal levels are used by your "Input pup" hardware. When the buttons are also connected to other harwdare (your light controller), you usually have to use level shifters to protect the Raspberry Pi inputs from voltages of the light controller and vice versa.

To react upon GPIO input changings you can use WiringPi[^]. It provides libraries and command line tools to configure the GPIO ports and do input and output.

For the software you have to decide which programming or script language you want to use and how you can get the information from your music queue.


这篇关于按下按钮可以显示自定义单词的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆