This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var serialport = require("serialport"); | |
| serialport.list(function (err, ports) { | |
| ports.forEach(function(port) { | |
| console.log(port.comName); | |
| }); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| int led = 9; // the pin that the LED is attached to | |
| int switch1 = 8; // the pin that switch 1 is attached to | |
| int switch2 = 7; // the pin that switch 2 is attached to | |
| boolean state1 = false; | |
| boolean state2 = false; | |
| int brightness = 0; // how bright the LED is | |
| int fadeAmount = 5; // how many points to fade the LED by | |
| void setup() { | |
| pinMode(led, OUTPUT); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void setup(){ | |
| Serial.begin(9600); | |
| } | |
| void loop(){ | |
| int sensorValue = analogRead(A0); | |
| Serial.println(sensorValue); | |
| delay(1); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @charset "UTF-8"; | |
| $a: #23d4a4; | |
| /*! | |
| * hi there 中文注释 #{$a} | |
| */ | |
| body { | |
| background-color: $a; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * 利用上传文件时间生成唯一ID,用于解决用户一次选择多个文件时,文件名相同的问题 | |
| * @return int Unix时间戳小数点右移四位取整 | |
| */ | |
| function upload_time() { | |
| list($msec, $sec) = explode(" ", microtime()); | |
| return ((int)$sec . (int)($msec * 10000)); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| define: function(name, data, superClass) { | |
| if(superClass) data.inherit = superClass; | |
| var Class = $.ui[name] = _createClass(function(el, options) { | |
| var obj = _createObject(Class.prototype, { | |
| _id: $.parseTpl(tpl, { | |
| name: name, | |
| id: _guid() |
NewerOlder