Skip to main content

Posts

Showing posts from May, 2022

IOT Experiment -5

   IOT Experiment -5 READ TEMPERATURE AND DISPLAY ON SERIAL MONITOR USING ARDUINO UNO IN DEGREE CELCUIS AND FAHREINHEIT SORCE CODE: const int sensor=A5; float tempc; float tempf; float vout; void setup(){   pinMode(sensor,INPUT);   Serial.begin(9600); } void loop(){   vout = analogRead(sensor);   vout=(vout *500)/1023; tempc=vout; tempf=(vout*1.8)+32; Serial.print("in DegreeC="); Serial.print("\t"); Serial.print(tempc); Serial.print("  "); Serial.print("in Fahrenheit=");   Serial.print("\t"); Serial.print(tempf); Serial.println(); delay(500); }

IOT Experiment -4

  IOT Experiment -4 READ TEMPERATURE AND DISPLAY ON SERIAL MONITOR USING ARDUINO UNO SORCE CODE: float temp; int temppin=0; void setup(){   Serial.begin(9600); } void loop(){   temp = analogRead(temppin);   temp=temp * 0.48828125;      Serial.print("temperature=");   Serial.print(temp);   Serial.print("*C");   Serial.println();   delay(1000); }

IOT Experiment -2

 IOT Experiment -2  LED INTENSITY VARIATION SORCE CODE: void Setup()  {  // initialize digital pin 5,6,7 & 8 as an output.  pinMode(5, OUTPUT);  pinMode(6, OUTPUT);  pinMode(7, OUTPUT);  digitalWrite(5, HIGH);  digitalWrite(6, HIGH);  digitalWrite(7, HIGH);  }   void Loop()  {  digitalWrite(5, HIGH);  digitalWrite(6, LOW);  digitalWrite(7, LOW);  delay(500); digitalWrite(5, LOW); digitalWrite(6, LOW); digitalWrite(7, HIGH); delay(500); digitalWrite(5, LOW); digitalWrite(6, HIGH); digitalWrite(7, LOW); delay(500); int red_light_pin= 7; int green_light_pin = 6; int blue_light_pin = 5; int count = 0; void setup() {   pinMode(red_light_pin, OUTPUT);   pinMode(green_light_pin, OUTPUT);   pinMode(blue_light_pin, OUTPUT); } void loop() {   if (count >= 0 && count<=100)   {   RGB_color(255, 0, 255); // Yellow   delay(50);   count++;   }   else if (count >= 101 && count<=200)   {   RGB_color(0, 0, 255); // Green   delay(50);   count++;   }   else   {   RGB_color(