iPhone 作为开始按钮
我想开发一个(个人)iPhone 应用程序,以使用 iPhone 作为小型设备(例如风扇或灯泡)的控制器。有谁知道是否有某种可控制的 iphone-dock 可以用于类似的事情。是否有某种方法可以与这样的底座一起使用?例如,风扇只需要针对不同转速的可变电压。
提前致谢,
I would like to develop an (personal) iphone app to use the iPhone as a controller for a small device such as a fan or for example a light bulb. Does anyone know if there is some kind of controllable iphone-dock to use for something like this. And are there some kind of methods to use with such a dock? For example the fan just needs a variable voltage for different rpm.
Thanks in advance,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
EAAccessory
要求您成为 Apple 硬件合作伙伴,这非常昂贵且不容易(这就是为什么您只看到大公司发布 iOS 设备的硬件配件)。有几种方法可以解决这个问题。最简单的方法是让您的应用通过 WIFI 向 OSC 服务器发送 OSC 信号。我在 iPhone 上使用 TouchOSC 和 Arduino 通过 USB 连接到我的桌面。这一点也不难,但是需要你有一个连接到电脑的Arduino;这并不理想。
或者,您可以使用音频输出通过 iPhone 底座连接器中的线路输出发送命令,有效 将 iPhone 变成软件调制解调器。
祝你好运,如果你解决了这个问题,请将代码发布到 github 上。 :-D
EAAccessory
requires that you become a Apple hardware partner, which is very expensive and not easy (this is why you only see large companies releasing hardware accessories for iOS devices).There's a few ways around this. The easiest way is to have your app send OSC signals over WIFI to an OSC server. I've set this up before using TouchOSC on the iPhone and an Arduino connected to my desktop via USB. It's not hard at all, but it requires that you have an Arduino connected to a computer; it's not ideal.
Alternatively you can use audio output to send commands over the line output in the iPhone's dock connector, effectively turning the iPhone into a software modem.
Good luck and if you get this figured out, post the code on github. :-D
EAAccessory 框架可能不是您想要的,因为您需要拥有许可证和硬件。您可以更好地实现某种运行 arduino 或类似设备的小型网络服务器。检查这个一个例子。在arduino上,你可以只用一个5v继电器来控制任何设备的开关,并将继电器的其他引脚连接到热(或冷,取决于继电器状态)标准120v插头,这样你就可以将任何东西插入其中。 这里是一个用于直接串行控制的arduino控制继电器的好项目
,你可以做类似这个的事情,但这需要越狱。我认为对于个人应用程序来说,通过 wifi 进行操作将是最好的方法,除非您越狱并安装完整的蓝牙堆栈,而您不需要 EAAccessory 的东西
EAAccessory framework might not be what you want because of the requirement for you to have the license and hardware. You could better implement some sort of small webserver that runs an arduino or something similar. check this out for an example of that. on the arduino, you could just have a 5v relay to control the switch of whatever device and have the other pins of the relay connected to a hot (or cold depending on the relay state) standard 120v plug so you can plug anything into it. here is a good project for arduino controlled relay
for direct serial control, you could do something like this but it would require being jailbroken. i think for a personal app, doing it via wifi would be the best way unless you jailbreak and install the full bluetooth stack where you do not need EAAccessory stuff
查看 EAAccessory 框架。用于处理外部设备。
Check out EAAccessory Framework. Used to handle external devices.
您可以尝试使用连接到设备的超声波探测器,并在 iPhone 上以适当的频率播放音频文件等。
You could try using an ultrasound detector attached to your device, and playing an audio file at the appropriate frequency etc. on the iPhone.