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
//設定した時間内に行われた動作をカウントし、条件を満たしていると光る | |
//30秒以内に人が5回以上暗くなったら、光る | |
#define cdsPin 5 | |
#define ledPin 10 | |
#define ON LOW | |
#define OFF HIGH | |
int count=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
//設定した時間内に行われた動作をカウントし、条件を満たしていると光る | |
//30秒以内に人が5回以上通ったら、光る | |
#define echoPin 19 | |
#define trigPin 18 | |
#define ledPin 10 | |
#define ON LOW | |
#define OFF HIGH | |
double Duration = 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
// 暗くなるたびにカウントして、5回になったらLEDが光る | |
#define ledPin 10 | |
#define cdsPin 5 | |
#define ON LOW | |
#define OFF HIGH | |
int count=0; | |
float lux; | |
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
// 暗くなるたびにカウントして、5回になったら鳴る | |
#define SPEAKER 10 | |
#define cdsPin 5 | |
#define do 262 | |
#define re 294 | |
#define mi 330 | |
#define fa 349 | |
#define so 392 | |
#define ra 440 |
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
#define cdsPin 5 | |
#define ledPin 10 //OUTB | |
#define ON LOW | |
#define OFF HIGH | |
double luxnew = 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
#define cdsPin 5 | |
#define ledPin 10 | |
int count = 0; | |
#define ON LOW | |
#define OFF HIGH |
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
#define cdsPin 5 | |
#define ledPin 10 | |
#define ON LOW | |
#define OFF HIGH | |
int count = 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
#define cdsPin 5 | |
#define ledPin 10 | |
#define ON LOW | |
#define OFF HIGH | |
void setup() { | |
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
//光センサーとLEDで勉強してみよう | |
#define cdsPin 5 | |
#define ledPin 10 | |
#define ON LOW | |
#define OFF HIGH | |
void setup() { | |
Serial.begin(9600); |
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
#define cdsPin 5 | |
#define SPEAKER 10 | |
#define do 262 | |
#define re 294 | |
#define mi 330 | |
#define fa 349 | |
#define so 392 |