如何通过 4 个 LED 来判断 IP 地址?
我正在使用 .NET Micro Framework 开发网络管理设备。由于我们的想法是在办公室内拥有一堆设备,因此有时用户需要知道特定设备的 IP 地址。
因此,我一直在尝试提出如何向用户指示 IP 地址的想法。唯一的用户界面是 4 个 LED 灯,我可以以不同的速度闪烁。
到目前为止,我能想到的最好的想法是:看看 IP 地址如何有 4 个部分,并且我有 4 个 LED,每个 LED 负责一个 IP 地址部分是有意义的。 因此,对于像 192.168.0.34 这样的地址,我会让 LED1 闪烁一次,然后暂停,然后闪烁 9 次,暂停,然后闪烁 2 次。然后该动作将转移到 LED2,LED2 将以类似的方式闪烁 168 等等。数字 0 将通过快速闪烁半秒来表示。
还有其他想法吗?
I am developing a net-managed device with the .NET Micro Framework. Since the idea is to have a bunch of devices in an office, sometimes it is necessary for the user to know the IP address of a specific device.
So I've been trying to come with ideas on how to indicate the IP address the user. The only user interface is 4 LED lights that I can blink on and off at varying speeds.
So far, the best idea I could come up with is this: seeing how the IP address has 4 parts and I have 4 LEDs, it would make sense that each LED be responsible for a single IP address part.
So for address like 192.168.0.34, I'd have LED1 blink once, then pause, then blink 9 times, pause, then blink 2 times. The action would then shift to the LED2, which would blink out 168 in a similar manner and so on. Number 0 would be indicated by blinking really fast for half a second.
Any other ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(15)
对每个数字同时使用所有 4 个显示器,以二进制形式显示。快速闪烁所有 4 个灯代表 0,点亮所有 4 个灯更长的时间表示一个点。
或者,您可以使用未使用的数字(即:10)来表示 0
对于那些不懂二进制的人来说,设备准备好查找表应该足够了。
Use all 4 displays at once for each number, showing it in binary. Blink all 4 really fast for a 0, light all 4 longer to denote a point.
Alternatively you can use an un-used number (ie: 10) to denote 0
Having a lookup table ready by the device should be enough for those who don't know binary.
我会做相反的事情。从控制站,我会显示我的设备使用的所有 IP 的列表。然后我会选择一个以易于识别的模式开始闪烁(例如一遍又一遍地1 2 3 4)直到关闭。这样我就可以询问每个人谁的 LED 是这样闪烁的,并知道哪个设备拥有该 IP。
然后我会用魔术笔将 IP 写在设备底部。 Sharpie 具有惊人的带宽。
I'd do the reverse. From a control station, I would bring up a list of all IPs used by my devices. I'd then select one to start blinking in a pattern that would be easy to recognize (like 1 2 3 4 over and over) until shut off. That way I could ask everybody who's LEDs are blinking like that and know what device owned that IP.
I'd then write the IP on the bottom of the device in magic marker. There's an amazing amount of bandwidth in a sharpie.
提供一根安装良好的绳索,供用户像套索一样在空中摆动设备
然后像螺旋桨时钟一样让 LED 闪烁
(来源:embedds.com< /a>)
Provide a well-mounted cord for the user to swing the device around in the air like a lasso
Then flash the LEDs like a propeller clock
(source: embedds.com)
您也可以考虑二进制,一次显示一位数字。但这需要用户了解(或参加速成课程)二进制文件。
要指示小数点,您可以显示
1 1 1 1
。如果您有一个按钮或某种形式的用户交互,以便您可以迭代数字,那将是理想的选择。You might also consider binary, displaying a single digit at a time. But this would require the user to know (or take a crash course on) binary.
To indicate the decimal point, you could show
1 1 1 1
. It would be ideal if you had a button or some form of user interaction so that you could iterate through the digits.您可以将数字转换为十六进制并以二进制形式打印十六进制表示形式。
192.168.0.34 变为 C0.A8.00.22。与 @JYelton 提出的解决方案非常相似,只是进一步减少了个人从 LED 读取消息所需的工作量。但仍然需要一些翻译,因为您必须再次从十六进制转换为十进制(标准计算器是一个简单/方便的工具)。
You could translate the number to HEX and print off the hex representation in binary.
192.168.0.34 becomes C0.A8.00.22. Very similar to the solution put forth by @JYelton, just taken a step further to reduce the amount of work an individual needs to do to read the message out of the LEDs. Still require a bit of translation though because you have to go from hex to decimal again (standard calculator is an easy/handy tool).
我正在跳出框框思考..但我在这里看到的最大的抱怨之一是翻译。一个可以拍摄视频(录制的或预先录制的)并进行解释的应用程序怎么样?这让我想起了可以读取upc代码的iphone应用程序。
或者,但按照同样的想法,并行端口或 USB 怎么样?
I'm thinking outside the box.. but one of the biggest complaints I see here is the translation. What about an app that takes a video (recording or prerecorded) and does the interpretation? This reminds me of iphone apps that can read upc codes.
Alternatively, but along the same thought, what about a parallel port or usb?
你为什么不买一个外部液晶屏...没有教用户二进制,你可以显示加载更多信息。如果您向我提供您正在使用的微框架设备,我也许能够提供更详细的帮助。
Why don't you get an external LCD screen... no teaching users binary and you can display loads more information. If you provide me with which micro framework device you are using I may be able to provide more detailed help.
可以按照电话系统中脉冲拨号的方式进行操作。基本上一眨眼就是零,然后从那里开始计数。
Could do it the way that the pulse dialing worked in the phone system. Basically one blink is zero, and it counts up from there.
根据您的用户的极客程度,您还可以使用:
Depending on how geeky your users are, you could also use:
如果是 DHCP,并且他们可以访问计算机上设备 MAC 地址旁边的设备 IP 地址列表,您可以在每个设备上写入 MAC 地址,然后他们就能够知道哪个设备拥有哪个 IP。
如果您认为 MAC 地址太不用户友好,那么您可以有一个带有简短描述或设备名称的 MAC 地址表。
更重要的是,您可以编写一个程序来获取 MAC 地址旁边的 IP 地址列表,并将其与 MAC 地址旁边的设备名称表进行匹配。
if it's DHCP, and they can access a list of the devices ip addresses on a computer next to the devices' MAC addresses, you could write the MAC address on each device and then they'd be able to tell which device had which IP.
If you think MAC addresses would be too un user friendly then you could have a table of the MAC addresses with a short description or the name of the devices.
Even more, you could write a program that got the list of ip addresses next to MAC addresses and matched it up with the table of device names next to MAC addresses.
如果将其中一个 LED 替换为 IR LED,则可以为手机 IR 传感器编写一个应用程序,用于解码并显示 IP 地址的二进制模式。
If you replace one of the leds with an IR led, you can write an app for a cell phone IR sensor that decodes and displays the binary pattern for the IP address.
广播 UDP 数据包并使用 winforms 应用程序侦听这些数据包怎么样?如果您有多个此类设备,则以下方法可能有效。
这里可能有一个选项用于在设备中设置唯一的 ID(1-16 二进制),该 ID 显示在设备上并与 IP 信息一起广播。 (??DIP 开关??)
这避免了用户解释 LED 的二进制闪烁。
因此设备 1010 显示它的 LED,并且 Windows 应用程序中的输出显示
开、关、开、关 = 192.168.0.150
如果您对此感兴趣,使用 LED 开和关的图像会更好。
我处于类似的情况,尚未测试这些理论。
What about Broadcasting UDP packets and using a winforms app to listen for those packets. If you have multiple of these devices, the following might work.
There may be an option here to set a unique ID (1-16 binary) in the device that is displayed on the device and broadcast with the IP Information. (??DIP Switches??)
This gets away from having users interpreting binary flashing of the LED's.
So device 1010 shows it's LED's and the output in the Windows App shows
On, Off, On, Off = 192.168.0.150
If you got fancy with this using Images of an LED On and Off would be even better.
I'm in a similar situation and haven't tested these theories yet.
那么,IP 地址需要由机器还是人来解释呢?因为你的建议是使用十进制数字,这对人类来说很好,但对计算机来说很难理解。
IP地址实际上只是一个32位的二进制数。 IP 192.168.0.34 被路由器视为(并通过互联网广播)为 11000000 10101000 00000000 00100010
如果您有计算机或其他硬件设备解释 IP 地址,我建议仅使用二进制。您可以让一个灯显示下一个数字,另一个灯切换“就绪”灯以指示该数字实际上是下一个数字,而不是前一个数字的重复。这只需要 2 个 LED,并且您基本上会像这样显示上述地址:
on on,
开、关、
关闭 开启,
关掉,
关闭 开启,
关掉,
关闭 开启,
关掉,
就在,
关掉,
就在,
关掉,
就在,
关掉,
关闭 开启,
关掉,
等。
在读取第一位之前,请确保第二位已切换,否则您可能会读取相同的数字两次。
如果您想使用四个 LED 来显示它以供人类解释,那么让 LED 根据数字闪烁可能会很困难,因为人类很难同时计算 4 个数字。如果您只浏览所有数字 1、9、2、1、6、8、0、0、0、0、3、4(每个数字 3 位)并使用所有四个 LED 以二进制形式显示这些数字,可能会更容易。
关 关 关 开,
开 关 关 开,
关 关 关 关,
等等,
每一个之间都有一个停顿。
Well, does the IP address need to be interpreted by a machine or by a human? Because your suggestion is using decimal digits, which is wonderful for humans but very complicated for computers to understand.
IP addresses are actually just a 32-bit binary number. The IP 192.168.0.34 is seen by the router (and broadcasted across the internet) as 11000000 10101000 00000000 00100010
If you're having a computer or other hardware device interpret the IP address, I suggest just using binary. You could have one light which displays the next digit, and another which toggles a "ready" light to indicate that the digit is in fact the next one and not a repetition of the previous one. This would only require 2 LEDs, and you would essentially display the aforementioned address like so:
on on,
on off,
off on,
off off,
off on,
off off,
off on,
off off,
on on,
off off,
on on,
off off,
on on,
off off,
off on,
off off,
etc.
Make sure the second bit has toggled before reading the first bit, otherwise you could read the same number twice.
If you want to display it using four LEDs for human interpretation then having the LEDs blinks according to digit might be difficult since humans have trouble counting 4 numbers simultaneously. It may be easier if you just went through all the digits 1, 9, 2, 1, 6, 8, 0, 0, 0, 0, 3, 4 (3 digits per number) and displayed these in binary using all four LEDs.
off off off on,
on off off on,
off off on off,
etc.
With a pause in between each one.
添加 LCD 显示器确实效果很好,但会增加很多成本。但是,如果使用 8 个 LED 而不是 4 个呢?如果您购买带有小数点的 7 段 LED 显示屏形式的 8 个 LED,其成本可能不会比 4 个离散 LED 多多少,但它可以让您按顺序显示 IP 地址的十进制数字。无需用户掌握复杂的翻译方案。
Adding an LCD display would work really well, but would add a lot to the cost. However, what about using 8 LEDs instead of 4? If you purchase the 8 LEDs in the form of a 7-segment LED display with decimal point, it might not cost much more than 4 discrete LEDs, but it would let you display the decimal digits of the IP address sequentially. No complicated translation scheme for the users to master.
这取决于您的环境,但我不会显示整个 IP 地址,仅显示相关的组件,并将其本身映射到单个 4 位数字。这假设您只需要唯一地标识 < 2^4 个实体。如果您需要更多,则只需使用更多 LED(如果可能)。
这样,您只需要指定一个本地映射,然后就可以使用该映射通过本地内部网站查找实际的 IP 地址。您可以使用本线程中描述的典型二进制策略,让 LED 闪烁出 4 位数字,并且应该很容易培训人们(在设备上贴上适当的标签)。
It depends on your environment, but I'd not display an entire IP address, just the component that is relevant, and map that itself to a single 4-bit number. This assumes you only need to uniquely identify < 2^4 entities. If you need more, then just use more LEDs (if possible).
In this way, you'd only need to indicate a local mapping, which could then be used to look the actual IP address up via a local internal website. You can use the typical binary strategy that's been described in this thread already to have the LEDs flash out a 4bit number, and it should be pretty easy to train people on (which appropriate labeling on the device).