Develop script to test sensors (IR sensor)

Develop script to test sensors (IR sensor) - TinkerCad 


Tinker Cad circuit design:

Sensor testing circuit design


Components Required:

1) Arduino Uno R3
2) PIR Sensor
3) Piezo (Buzzer)
4) LED RGB


Code for above circuit:

int pirsesnor = 0;

void setup(){
  pinMode(2, INPUT);
  pinMode(12, OUTPUT);
  pinMode(13, OUTPUT);
}

void loop(){
  pirsesnor = digitalRead(2);
  if(pirsesnor == HIGH){
    digitalWrite(13, HIGH);
    tone(12,500,500);
  }
  digitalWrite(13, LOW);
}

Comments

Popular posts from this blog

Installing Hyper Ledger Fabric on Windows 10

Add the sensors to the Robot object and develop the line-following behavior code.

Create and deploy a block chain network using Hyperledger Fabric SDK for Java on Ubuntu 22.04 LTS