Skip to content

Instantly share code, notes, and snippets.

View lazytomatolab's full-sized avatar

LazyTomato Lab 懶番茄工作室 lazytomatolab

View GitHub Profile
@lazytomatolab
lazytomatolab / Class_14_1.ino
Last active February 14, 2025 04:38
【Arduino SpeedUp】快速上手 Class 14 - 迴圈 while 稱霸 Arduino!更多資訊請造訪:http://www.lazytomatolab.com
void setup() {
pinMode(7, INPUT);
digitalWrite(7, HIGH);
pinMode(13, OUTPUT);
while(digitalRead(7) == HIGH) {
digitalWrite(13, HIGH);
delay(200);
digitalWrite(13, LOW);
delay(200);
@lazytomatolab
lazytomatolab / Class_5.ino
Created November 6, 2016 12:48
【Arduino SpeedUp】快速上手 Class 5 - 麵包板是什麼?好吃嗎?更多資訊請造訪:http://www.lazytomatolab.com/
void setup() {
pinMode(7, INPUT);
digitalWrite(7, HIGH);
pinMode(13, OUTPUT);
}
void loop() {
if(digitalRead(7) == HIGH){
digitalWrite(13, HIGH);
}
@lazytomatolab
lazytomatolab / Class_13_1.ino
Created December 23, 2018 12:20
【Arduino SpeedUp】快速上手 Class 13 - 迴圈 for 讓你功力大提升!更多資訊請造訪:http://www.lazytomatolab.com
void setup() {
pinMode(13, OUTPUT);
digitalWrite(13, LOW);
for(int counter = 0; counter < 10; counter++) {
digitalWrite(13, HIGH);
delay(200);
digitalWrite(13, LOW);
delay(200);
}
@lazytomatolab
lazytomatolab / Class_11_1.ino
Created September 27, 2017 03:07
【Arduino SpeedUp】快速上手 Class 11 - Serial monitor 讀心術!更多資訊請造訪:http://www.lazytomatolab.com
void setup() {
Serial.begin(115200);
Serial.println("Hello! This is LazyTomato Lab!");
delay(1000);
Serial.println("Please visit: http://www.lazytomatolab.com/");
}
void loop() {
}
@lazytomatolab
lazytomatolab / Class_12.ino
Created December 23, 2017 13:55
【Arduino SpeedUp】快速上手 Class 12 - 分類帽 switch case 降臨!更多資訊請造訪:http://www.lazytomatolab.com
void setup() {
Serial.begin(115200);
}
void loop() {
if(Serial.available()) {
int num = Serial.parseInt();
switch(num) {
case 1:
@lazytomatolab
lazytomatolab / Class_4.ino
Last active October 25, 2017 08:43
【Arduino SpeedUp】快速上手 Class 4 - 判斷式 if else 讓你操縱自如!更多資訊請造訪:http://www.lazytomatolab.com/
void setup() {
pinMode(7, INPUT);
pinMode(13, OUTPUT);
}
void loop() {
if(digitalRead(7) == HIGH){
digitalWrite(13, HIGH);
}
else{
@lazytomatolab
lazytomatolab / Class_10_1.ino
Created August 20, 2017 13:51
【Arduino SpeedUp】快速上手 Class 10 - 互動?遊戲?按鈕特輯 3!更多資訊請造訪:http://www.lazytomatolab.com
boolean state = false;
boolean buttonUp = true;
void setup() {
pinMode(7, INPUT);
pinMode(8, OUTPUT); // INA
digitalWrite(8, LOW);
pinMode(9, OUTPUT); // INB
digitalWrite(9, LOW);
}
@lazytomatolab
lazytomatolab / Class_3.ino
Last active September 27, 2017 02:58
【Arduino SpeedUp】快速上手 Class 3 - 完成你的第一個專案!更多資訊請造訪:http://www.lazytomatolab.com/
void setup() {
pinMode(13, OUTPUT);
}
void loop() {
digitalWrite(13, HIGH);
delay(1000);
digitalWrite(13, LOW);
delay(1000);
}
@lazytomatolab
lazytomatolab / Class_9.ino
Last active July 2, 2017 12:39
【Arduino SpeedUp】快速上手 Class 9 - 邏輯?旗標?按鈕特輯 2!更多資訊請造訪:http://www.lazytomatolab.com
boolean state = false;
boolean buttonUp = true;
void setup() {
pinMode(13, OUTPUT);
digitalWrite(13, LOW);
pinMode(7, INPUT);
digitalWrite(7, HIGH);
}
@lazytomatolab
lazytomatolab / Class_8_1.ino
Created April 30, 2017 17:09
【Arduino SpeedUp】快速上手 Class 8 - 互動?遊戲?按鈕特輯!更多資訊請造訪:http://www.lazytomatolab.com
void setup() {
pinMode(7, INPUT);
digitalWrite(7, HIGH);
pinMode(13, OUTPUT);
}
void loop() {
if(digitalRead(7) != HIGH){
digitalWrite(13, HIGH);
}