Saturday, 23 February 2019
Saturday, 26 January 2019
Thursday, 27 December 2018
Wednesday, 26 December 2018
Tuesday, 3 July 2018
Wednesday, 21 March 2018
How To Use Infrared (IR) sensor with Arduino
the code i used is :
int value;
int ledPin = 13;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode (ledPin,OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
value = analogRead(A0);
if (value<100){
digitalWrite(ledPin,HIGH);
Serial.println(value);
}else {
digitalWrite(ledPin,LOW);
Serial.println(value);
}
delay(1);
}
int value;
int ledPin = 13;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode (ledPin,OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
value = analogRead(A0);
if (value<100){
digitalWrite(ledPin,HIGH);
Serial.println(value);
}else {
digitalWrite(ledPin,LOW);
Serial.println(value);
}
delay(1);
}
Subscribe to:
Posts (Atom)