11/29/2015
Photoresistor, Arduino circuit.
Changing the light intensity of an LED by using a photo resistor.
And here's my codes,
const int PhotoPinNo = 0;
const int LedPinNo = 3;
int val;
void setup() {
pinMode(LedPinNo, OUTPUT);
}
void loop()
{
val = analogRead(PhotoPinNo);
BrightTune();
analogWrite(LedPinNo, val);
}
void BrightTune()
{
val = map(val, 450, 850, 255, 0);
val = constrain(val, 0, 255);
라벨:
아두이노,
C,
Computer Programming,
IoT
피드 구독하기:
댓글 (Atom)
블로그 보관함
Categories
Labels
Advertising
Disqus Shortname
Popular Posts
-
유니티 튜토리얼 진행중에 둘의 차이점이 궁금해졌다. 어떨때는 gameObject로 사용하다가 어떨때는 GameObject로 사용하고.. 유니티 매뉴얼을 뒤져보면 GameObject는 Base Class로 Object Class를 상속 받고....
-
http://hotgott.tumblr.com/post/144729116411/python-code-test-a-basic-linear-regression
-
“”“ S1Q10A: Total personal income in last 12M (Quantitative) SINTOCAT: Total personal imcome in last 12M (Categorical, Low: 0~30%, Medium: ...
-
It’s a sequel to the 1st assignment - study on the relationship b.t.w personal income and smoking amount. It’s already been verified thro...
-
1. Make Mistake That's what I've done so far. 2. Scrap the Foreign Alphabet Make sense when it comes to English, however,...
-
Here's my codes, const int LedPin = 3; const int PotPin = 0; static int val=0; void setup() { pinMode(LedPin, OUTPUT); } v...
-
http://hotgott.tumblr.com/post/144729047356/assignment-test-a-basic-linear-regression-model
댓글 없음:
댓글 쓰기