Skip to content

Instantly share code, notes, and snippets.

var serialport = require("serialport");
serialport.list(function (err, ports) {
ports.forEach(function(port) {
console.log(port.comName);
});
});
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);
void setup(){
Serial.begin(9600);
}
void loop(){
int sensorValue = analogRead(A0);
Serial.println(sensorValue);
delay(1);
}
@charset "UTF-8";
$a: #23d4a4;
/*!
* hi there 中文注释 #{$a}
*/
body {
background-color: $a;
<?php
/**
* 利用上传文件时间生成唯一ID,用于解决用户一次选择多个文件时,文件名相同的问题
* @return int Unix时间戳小数点右移四位取整
*/
function upload_time() {
list($msec, $sec) = explode(" ", microtime());
return ((int)$sec . (int)($msec * 10000));
}
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()