Posts

Showing posts from August, 2023

Portfolio using HTML

  <! DOCTYPE html > < html lang = "en" > < head >     < meta charset = "UTF-8" >     < meta name = "viewport" content = "width=device-width, initial-scale=1.0" >     < title >Document</ title > </ head > < body bgcolor = "black" >     < font size = "4" face = "Algerian" color = "White" >         < marquee scrollamount = "10" behavior = "scroll" direction = "left" >             < ----This is my own Portfolio---->             </ marquee >     </ font >     < center >         < img src = "Dipchandri.png" alt = "error 404" >< br >         < font size = "5" face = "Algerian" color = "Yellow" >             < big >< u >Dipchandri Ghosh</ u >...

Object detector using Ardiuno

 #define trigpin 8#define echopin 7 #define ledpin 6 #define buzzer 3 void setup() {   // put your setup code here, to run once: pinMode(trigpin,OUTPUT);  pinMode(echopin,INPUT);  pinMode(ledpin,OUTPUT);   pinMode(buzzer,OUTPUT);  Serial.begin(9600);} void loop() {   // put your main code here, to run repeatedly:   digitalWrite(trigpin,LOW);  delayMicroseconds(2);   digitalWrite(trigpin,HIGH);  delayMicroseconds(10);   digitalWrite(trigpin,LOW);   int duration = pulseIn(echopin,HIGH);   int distance =(duration/2) / 29.1;   if(distance<=20)  {     Serial.println("Object Nearby");    digitalWrite(ledpin,HIGH);     tone(buzzer,10000,500);       }  else   {    Serial.println("Path Clear");     digitalWrite(ledpin,LOW);    noTone(buzzer);       } }

Calculator for Arithmetic Operations using C Language

  #include <stdio.h> int main () {   char op;   double first, second;   printf ( "Enter an operator (+, -, *, /): " );   scanf ( " %c " , & op);   printf ( "Enter two operands: " );   scanf ( " %lf %lf " , & first, & second);   switch (op) {     case '+' :       printf ( " %.1lf + %.1lf = %.1lf " , first, second, first + second);       break ;     case '-' :       printf ( " %.1lf - %.1lf = %.1lf " , first, second, first - second);       break ;     case '*' :       printf ( " %.1lf * %.1lf = %.1lf " , first, second, first * second );       break ;     case '/' :       printf ( " %.1lf / %.1lf = %.1lf " , first, second, first / second);       break ;     // operator doesn't match any case constant     default :      ...

Comment and Escape Sequence

  # Comments, Escape Sequence # Comments # '#' is used for single line comment """ we can use three double inverted comma to comment multiple lines """ # Esacape Sequence """ \n is used for new line end="" is used to specify what to print at last. Default for end="" is \n sep="" is used to seperate items with perticular char. Default is 'space' """ print ( "Hey" , "Kemon" , "Acho" , sep = "~" ) print ( "#" , end = " 007" )

Python input output

  #Input Output print ( "Hello World" ) #string output #default input-output a = 5 b = 10 print (a + b) #User input a = input ( "Enter to print:" ) #naturally it takes string input print (a) b = int ( input ( "Enter to print:" )) #int input print (b)