展示HN:我扭伤了脚,所以利用旧手机的传感器制作了一个恢复警报。
我在打羽毛球时扭伤了脚。医生说恢复的最佳方法是保持脚抬高。但我无法准确判断我的脚是否处于正确的抬高位置。
于是,我开发了一个小应用来解决这个问题。每部智能手机内部都有运动传感器,包括加速度计(测量X、Y、Z方向的运动)和陀螺仪(测量倾斜和旋转)。当手机绑在我的脚上时,应用会读取这些传感器的数值。它会持续检查角度,以判断我的脚是否处于正确的抬高位置。
如果我的脚抬得很好,应用会显示一个绿色勾。如果脚悬挂下垂超过几分钟,手机会发出声音、震动并闪烁红色光来提醒我。
这是一个有趣的小创意,但它确实帮助我更好地恢复,确保我的脚保持在应该的位置。我最终给它起了个名字叫“抬高警察”。它是我个人的脚踝监测器,为了我自己的健康而不断提醒我。
查看原文
I twisted my foot while playing badminton. The doctor said the best way to recover is to keep it elevated. But I couldn’t really track whether my foot was in the proper elevated position or not.<p>So, I built a little app to solve this. Every smartphone already has motion sensors inside it. The accelerometer (measures movement in X, Y, Z directions) and the gyroscope (measures tilt and rotation). App reads these sensor values while the phone is strapped to my foot. It checks the angle continuously to know whether my foot is properly elevated or not.<p>If my foot is in a good elevated position, it shows me a green check. If it’s hanging down for more than a few minutes, the phone makes noise, vibrates, and flashes red to remind me.<p>It’s a fun little hack, but it actually helps me recover better by making sure my foot stays where it should. I ended up calling it “Elevation Police”. It's my personal ankle monitor that nags me for my own good.<p>discussion - <a href="https://x.com/the2ndfloorguy/status/1968306219371655227" rel="nofollow">https://x.com/the2ndfloorguy/status/1968306219371655227</a>