查看Arduino 精要的源代码
←
Arduino 精要
跳转到:
导航
,
搜索
因为以下原因,你没有权限编辑本页:
您刚才请求的操作只有这个用户组中的用户才能使用:
用户
您可以查看并复制此页面的源代码:
== 总览 == [[Arduino I/O 之数字输入输出]] [[Arduino I/O 之模拟输出]] [[Arduino I/O 之数字输出扩流]] [[Arduino memory]] [[深入 PWM]] [[撰写自己的 Arduino 库]] [[阻抗和阻抗匹配]] [[晶振电路]] [[SPI 总线精要]] [[I2C 总线精要]] <br><br> == 扩展 == [[Arduino Ethernet 的另一性价比选择]] [[DHT21/AM2301 数字温湿度传感器]] [[DHT11 数字温湿度传感器]] [[夏普 GP2Y1010AU0F 灰尘传感器]] [[PT550 光敏二极管光线传感器]] <br><br> == 应用 == [[Arduino 监控客厅温度湿度]] <br><br> == 精华 == [[Arduino bootloader 的烧写]] [[面包板上的至简 Arduino]] [[动手焊一个自己的 Arduino]] [[Arduino 低功耗优化]] [[ATtiny13]] <br><br> == 糖豆 == === float2str === <source lang=java> String(NUMBER, SCALE); String(3.141592,5); # "3.14159" </source> <br><br> === Software Serial === <source lang=java> #include <SoftwareSerial.h> SoftwareSerial mySerial(10, 11); // RX, TX void setup() { // set the data rate for the SoftwareSerial port mySerial.begin(4800); mySerial.println("Hello, world?"); } void loop() { if (mySerial.available()) mySerial.write(Serial.read()); } </source> <br><br> === AT CMD === SerialEvent() is called after a loop(), if there is serial data in the buffer. <source lang=java> String input_str = ""; // a string to hold incoming data boolean str_over = false; // whether the string is complete void setup() { Serial.begin(9600); input_str.reserve(200); // reserve 200 bytes for the inputString: } void loop() { if (str_over) { // Identify the CMD and processing input_str = ""; // clear the string buffer str_over = false; } } /* * SerialEvent occurs whenever a new data comes in the hardware serial RX. * This routine is run between each time loop() runs, so using delay inside * loop can delay response. Multiple bytes of data may be available. */ void serialEvent() { while (Serial.available()) { char in = (char)Serial.read(); input_str += in; if (in == '\n') { // read a line into string buffer str_over = true; } } } </source> <br><br> === Hex str to ull === <source lang=cpp> char hexstr2bin(char c) { if (isdigit(c)) { // 0 - 9 return c - '0'; } else if (isxdigit(c)) { // A-F, a-f return (c & 0xF) + 9; } return -1; } unsigned long long hexstr2ull(char * string) { unsigned long long x =0; char c; do { c = hexstr2bin(*string++); if (c < 0) break; x = (x << 4) | c; } while (1); return x; } </source> <br><br> == 资源 == * 二极管选型指南:http://www.vishay.com/docs/49627/49627.pdf * [https://product.tdk.com/info/zh/products/capacitor/ceramic/mlcc/technote/solution/mlcc03/index.html 将电解电容器更换为MLCC的指南] * [http://wiki.jackslab.org/images/Mcu.3v.tips.pdf MCU 3V Tips] * [http://www.murata.com/zh-cn/products/emiconfun-tw/capacitor/2013/02/14/tw-20130214-p1 電容器阻抗/ESR頻率特性] * [http://www.analog.com/library/analogDialogue/china/archives/45-01/bypass_capacitors.html 低压差调节器—为什么选择旁路电容很重要] * [http://www.mem.com.tw/article_content.asp?sn=0808270006 精算陶瓷電容性能表現] * http://www.robopeak.com/blog/?p=107 * spi flash: http://forum.arduino.cc/index.php?topic=178462.0 * http://www.avrfreaks.net/forum/winbond-spi-flash-library-avr-arduino-written-c * avr-libc user manual: http://www.nongnu.org/avr-libc/user-manual/modules.html <br><br> <br><br> <br><br> <br><br> <br><br> <br><br> <br><br>
返回到
Arduino 精要
。
个人工具
登录
名字空间
页面
讨论
变换
查看
阅读
查看源代码
查看历史
操作
搜索
导航
首页
社区专页
新闻动态
最近更改
随机页面
帮助
工具箱
链入页面
相关更改
特殊页面