Fcongeigao Rodrigues College of Engneerhngffrgrge: Coding
Fcongeigao Rodrigues College of Engneerhngffrgrge: Coding
To interfa ce a Humidity-Temperature /UItrasonic Sensor to the Arduino Uno (Pro teus VSM
/Hardware)
Theory:
Writing Sketches
CONGELCA ES C
Programs written using Arduino Software (IDE) are called sketches. These
sketches are written in the text editor and are saved with the file
Algorithm:
1. Start
Code:
int b1 = 2;
int d1 = 5;
int cnt=0,cnt2;
int timer=0;
int pos = 0;
void setup() {
Serial. begin(9600);
pinMode(b1, INPUT_PULLUP);
pinMode(d1, OUTPUT );
digitalWrite(d1, HIGH);
digitalWrite (d1,LOW);
delay(300);
cnt=0;
void loop() {
digitalWrite(d1, HIGH);
delay(300);
digitalWrite(d1, LOW);
delay(300);
digitalWrite(d1, HIGH);
delay(300):
digitalWrite(d1, LOW);
delay(300);
digitalWrite(d1, HIGH);
delay(300 );
digitalWrite(d1, LOW) ;
delay(300 );
vibra ino
int bi- 2;
int d1 5:
t2;
Virtual Terminal
TPL VIRRATTON ALRRT
N VIBiwTION AlBRT
Lo3ICST VIRRATONN
nB1
atiov
ARDT
ViIbratlon Sensor
UES COLLE
Exyevimert 6