TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: Serial communication using the WebAudio API

49 pointsby ecubedalmost 12 years ago

7 comments

ecubedalmost 12 years ago
I'd appreciate any feedback, especially from more experienced devs. I built this JS class to send serial commands over the headphone port of an iPhone using Javascript and the HTML5 WebAudio API. This enabled me to use an iPhone application to control my embedded systems design senior project.
评论 #5929953 未加载
评论 #5929687 未加载
revelationalmost 12 years ago
I don&#x27;t know about the JavaScript code, but I did look at the uC code (EE459 repo I guess?).<p>Since you are already taking the flash hit with sprintf, you might be interested to know that you can redirect stdout to print all data through your serial line, i.e. just using printf. Saves going through an intermediate buffer. Looks something like this:<p><a href="http://pastie.org/8073251" rel="nofollow">http:&#x2F;&#x2F;pastie.org&#x2F;8073251</a>
评论 #5929819 未加载
RyanZAGalmost 12 years ago
Great hack and worth doing just because it is a great hack, but since it was a senior project, wouldn&#x27;t it have been easier to just grab an old Android phone off Ebay and use standard 2-way communication directly?
评论 #5929689 未加载
评论 #5929716 未加载
zarothalmost 12 years ago
Here&#x27;s something similar doing FSK with Javascript and HTML5 audio:<p><a href="https://github.com/NeoCat/FSK-Serial-Generator-in-JavaScript/" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;NeoCat&#x2F;FSK-Serial-Generator-in-JavaScript...</a>
samsquirealmost 12 years ago
You could have applications that talk with your smartphone without a network and just a browser providing you can access your microphone in Android and iOS. reply
评论 #5929714 未加载
masswerkalmost 12 years ago
Very neat! Maybe you could even implement read using navigator.userGetMedia to provide two way communications ...
mmastracalmost 12 years ago
Neat project, but would be great to see a demo page.<p>Also, s&#x2F;buad&#x2F;baud&#x2F;
评论 #5929718 未加载