This file contains 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
// 七段顯示器製作倒數功能 (v1) | |
int potPin=3; | |
byte seven_seg_digits[10][7] = { | |
{ 1,1,1,1,1,1,0 }, // = 0 | |
{ 0,1,1,0,0,0,0 }, // = 1 | |
{ 1,1,0,1,1,0,1 }, // = 2 | |
{ 1,1,1,1,0,0,1 }, // = 3 | |
{ 0,1,1,0,0,1,1 }, // = 4 | |
{ 1,0,1,1,0,1,1 }, // = 5 | |
{ 1,0,1,1,1,1,1 }, // = 6 |
This file contains 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
// 引用 Keypad library | |
#include <Keypad.h> | |
#include <Password.h> | |
#include <Wire.h> | |
#include <LiquidCrystal_I2C.h> | |
LiquidCrystal_I2C lcd(0x27,16,2); | |
char *pwd={"123"}; | |
Password password = Password(pwd); |
This file contains 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
#include <Wire.h> | |
#include <LiquidCrystal_I2C.h> | |
#include <virtuabotixRTC.h> | |
//use interrupt 0 -> pin 2 (button0) | |
#define lock 0 | |
//button1 | |
#define add_sec 4 | |
//button2 | |
#define add_min 3 |
This file contains 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
#include <Servo.h> | |
#include <IRremote.h> | |
//IR | |
int RECV_PIN = 11; | |
IRrecv irrecv(RECV_PIN); | |
decode_results results; | |
const unsigned long IRmove1 = 0XFF30CF; | |
const unsigned long IRmove2 = 0XFF18E7; | |
const unsigned long IRmove3 = 0XFF7A85; |
This file contains 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
//set up pin | |
const int buttonPin = 2; | |
const int hornPin = 3; | |
const int ohm=5; | |
//data | |
int music[5]={0,0,0,0,0}; | |
int point=0; | |
int sensor=0; | |
boolean buttonState=LOW; | |
long lastDebounceTime = 0; |
This file contains 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
// Lab01 | |
// LM35 + 4*7 segment Display | |
// 七段顯示器 reference: Cooper Maa | |
// define the LED digit patterns, from 0 - 9 | |
// 1 = LED on, 0 = LED off, in this order: | |
// Arduino pin: 2,3,4,5,6,7,8 (Mapping a,b,c,d,e,f,g of Seven-Segment LED) | |
byte seven_seg_digits[10][7] = { { 1,1,1,1,1,1,0 }, // = 0 | |
{ 0,1,1,0,0,0,0 }, // = 1 | |
{ 1,1,0,1,1,0,1 }, // = 2 |
This file contains 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
//NCTU_Embedded system_Arduino_Lab02 | |
//Read and compare sensor | |
//then display on 5*7 LED matrix | |
//show the "HelloWorld" and shift left or right by the comparison | |
//display like this project:http://musicdiver.com/wordpress/2013/01/arduino-scrolling-text-on-5x7-led/ | |
int scan=0; | |
int matrix[7][50]; | |
//transform letter to 5*7 LED matrixs |
This file contains 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
Doctype | |
html | |
head | |
meta(charset='utf-8') | |
title #{title} | |
script(src='/javascripts/Chart.min.js') | |
body | |
canvas#myChart | |
script(type="text/javascript"). | |
var data = { |
This file contains 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 express = require('express'); | |
var router = express.Router(); | |
/* GET home page. */ | |
router.get('/', function(req, res, next) { | |
var chartData = []; | |
for (var i = 0; i < 7; i++) | |
chartData.push(Math.random() * 50); | |
res.render('index', { title: 'Express', chartData: JSON.stringify(chartData) }); |
This file contains 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
form#formArticle(role="form") | |
div.form-group | |
label(for="createArticleTitle") Article Title | |
textarea.form-control(row="1" name="title") | |
label(for="createArticleBody") Article Body | |
textarea.form-control(row="6" name="description") | |
button(type="submit") | |
//使用jquery的serialize()-直接將form各個欄位值轉為POST/GET傳遞的格式 | |
//Use Jquery serialize() function - turn the values of cloumns in form into POST/GET format | |
//*項目必須要有 name |
OlderNewer