digispark arduino中断如何使用啊?

User Tools
Site Tools
ToolsShow pagesourceOld revisionsBacklinksRecent ChangesMedia ManagerSitemapLog In&
digispark:policy
Table of Contents
Digispark License Terms
The Digispark design (schematic, layout, concept) is licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported License:
Digispark Shields and other Digispark products are licensed under the license listed on the board and/or design - generally CC-BY-SA 3.0 or CC-BY-NC-SA 3.0 ().
Can I make my own Digisparks? (or derivatives)
For personal use - yes without a doubt! We'll even provide EagleCAD files to make it easy!
To sell or give away - yes you can, but we request that you make your offering unique in some way, and you must give it its own name (see the next section).
Can I call my Digispark clone/derivative a &Digispark& (or a derivative of the name)
Possibly, Digistump LLC retains all rights to the Digispark name and logo as well as the Digistump name and logo. If you'd like to make an official Digispark product please contact us at support (at) digistump (dot) com. The Digispark name and logo (or derivatives of them) may not be used without express written permission from Digistump LLC.
Why? Direct clones are a challenge for any open source company, because not only do they introduce an inferior product that may damage the reputation of the original, but they also tax the resources (support requests, angry customers with clones, clones being returned) of both the community and company. We're a small company, there are just two of us, so we've decided (like Arduino) or protect the name of our products to ensure that Digispark and Digistump branded devices are authentic, well supported, and you can buy them knowing you are supporting future Digistump creations.
These restrictions apply to shields as well - however - in the case of both shields and development board derivatives, you are welcome to mention that your device is Digispark compatible.
You are also free to use the Digispark name in reference to our devices in tutorials, project write ups, etc. You may not imply that your product, project, or work is affiliated or endorsed by Digistump LLC or the Digispark team in any way.
I want to partner with Digistump to make a licensed shield, derivative, etc
Contact us: support (at) digistump (dot) com - we'd love to work with you!
Page ToolsiOS百度云的“后台继续传输”是如何实现的?
iOS百度云的“后台继续传输”是如何实现的?
iOS百度云的“后台继续传输”是如何实现的?
新版本中的“后台继续传输”可以说让用户在传输文件时体验更佳,这一功能的实现,我们将可以在退出界面后去进行其他操作,而上传下载文件不会中断。而不是像其他应用一样,如果需要传输文件的话就必须一致保持在传输界面不能进行任何操作。要知道,如果传输耗时较长的话,这个后台继续传输功能是极具实用性的。如下图所示,小编将手机中的文件上传至百度云中,图中上传按键处已出现了109的提示信息,而此时小编按下home键,待过5分钟后,再次进入百度云,发现所需上传的照片在后台已经完全传至百度云中。
使用GCD的方式,按了home键后,程序应该还可以后台运行10分钟
请问,你知道如何后台上传图片了吗?指点下。我也在做这个。
Copyright & 2016 phpStudy如何用不到10元人民币 DIY 一个 YubiKey
DigiSpark 开发板
需要用到的额外材料就是图中的 DigiSpark ,在淘宝上大约在10元人民币左右。
DigiSpark 其实是一个小型的类似 Arduino 的开发版,我们可以写代码刷到板子中的芯片里,芯片可以按照代码执行一些简单的任务。最近看到很多人都在海淘 YubiKey 这种小巧的密码保存器,因为正好 DigiSpark 本身有模拟 HID 的功能,何不自己做一个。
板子插到 USB 之后的效果
注意我的手指没有挨着板子,这个时候进入 LastPass 或者 PasswordSafe 等软件的主密码输入界面,然后手轻轻碰一下板子的背部,效果如下图。
板子上的第二个 LED 灯亮起,这个时候会模拟键盘把预先烧到芯片中的密码输入到电脑里。
代码其实很简单,如下。
1&span class=&com&&#&/span&&span class=&kwd&&include&/span& &span class=&str&&&DigiKeyboard.h&&/span&
1&span class=&kwd&&void&/span&&span class=&pln&& setup&/span&&span class=&pun&&()&/span& &span class=&pun&&{&/span&
1&span class=&pln&& pinMode&/span&&span class=&pun&&(&/span&&span class=&lit&&0&/span&&span class=&pun&&,&/span&&span class=&pln&& INPUT&/span&&span class=&pun&&);&/span&
1&span class=&pln&& pinMode&/span&&span class=&pun&&(&/span&&span class=&lit&&1&/span&&span class=&pun&&,&/span&&span class=&pln&& OUTPUT&/span&&span class=&pun&&);&/span&
1&span class=&pun&&}&/span&
1&span class=&kwd&&void&/span&&span class=&pln&& loop&/span&&span class=&pun&&()&/span& &span class=&pun&&{&/span&
1&&span class=&kwd&&if&/span& &span class=&pun&&(&/span&&span class=&pln&&digitalRead&/span&&span class=&pun&&(&/span&&span class=&lit&&0&/span&&span class=&pun&&)&/span& &span class=&pun&&==&/span&&span class=&pln&& HIGH&/span&&span class=&pun&&)&/span& &span class=&pun&&{&/span&
1&span class=&pln&& digitalWrite&/span&&span class=&pun&&(&/span&&span class=&lit&&1&/span&&span class=&pun&&,&/span&&span class=&pln&& HIGH&/span&&span class=&pun&&);&/span&
1&&span class=&typ&&DigiKeyboard&/span&&span class=&pun&&.&/span&&span class=&pln&&sendKeyStroke&/span&&span class=&pun&&(&/span&&span class=&lit&&0&/span&&span class=&pun&&);&/span&
1&&span class=&typ&&DigiKeyboard&/span&&span class=&pun&&.&/span&&span class=&pln&&println&/span&&span class=&pun&&(&/span&&span class=&str&&&YouPasswordHere&&/span&&span class=&pun&&);&/span&
1&&span class=&pun&&}&/span&
1&&span class=&typ&&DigiKeyboard&/span&&span class=&pun&&.&/span&&span class=&pln&&delay&/span&&span class=&pun&&(&/span&&span class=&lit&&5000&/span&&span class=&pun&&);&/span&
1&span class=&pln&& digitalWrite&/span&&span class=&pun&&(&/span&&span class=&lit&&1&/span&&span class=&pun&&,&/span&&span class=&pln&& LOW&/span&&span class=&pun&&);&/span&
1&span class=&pun&&}&/span&
用 Arduino 密码下载的 IDE 就可以把代码直接烧到板子上,非常方便。比较适合的场景包括开机密码,前面说的密码管理器的主密码,TrueCrypt 等软件的加密密码等,但不适合在线密码。
几个问题:
密码是明文的,可以 dump 出来,注意不要直接使用它存储在线密码。
芯片和板子会损坏,所以一定要有备份。
可以存储多个密码,但需要修改代码,并且***几个 Button,用 Button 或 Button 组合区分。
理论上可以实现 FIDO U2F ,但我没有具体实验,如果你有兴趣欢迎联系我。
Happy Hacking
我真的不是自黑!
最热点击文章
微信公众号
扫描下方二维码或者搜索二维码下方的微信公众号

参考资料

 

随机推荐