Skip to main content

blood pressure using arduino code with lcd display


// include the library code:
#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(13, 12, 11, 10, 9, 8);

int buttonState = 0;         // variable for reading the pushbutton status

// These constants won't change.  They're used to give names
// to the pins used:
const int analogInPine = A0;  // Analog input pin that the potentiometer is attached to
const int analogInPinb = A1;  // Analog input pin that the potentiometer is attached to

int sensorPin = A5;    // select the input pin for the potentiometer
int sensorValue = 0;  // variable to store the value coming from the sensor
int count=0,fl;
unsigned long time1=0;  // store the initial time
unsigned long time2;    // store the current time
  int count1;

int sensorValue1 = 0;        // value read from the pot

void setup() {
     
  lcd.setCursor(0, 0);
  lcd.print("PRESSURE:            ");
   
}

void loop() {
  // read the analog in value:


  sensorValue1 = analogRead(A0)/2;
  sensorValue1 = analogRead(A0)/2;


if(sensorValue1>140)
{
digitalWrite(2,0);
}
else
{
  digitalWrite(2,1);
}

  if(sensorValue1>=160)
    sensorValue1=160;

  if(sensorValue1>100)
  {
  lcd.setCursor(0, 1);
   
  lcd.write((sensorValue1/100)+0x30);    

  lcd.write(((sensorValue1%100)/10)+0x30);    

  lcd.write((sensorValue1%10)+0x30);      
    delay(20);
  lcd.setCursor(8, 1);
  delay(20);  
       delay(20);    
  lcd.write(((sensorValue1-29)/100)+0x30);    
      delay(20);
  lcd.write((((sensorValue1-29)%100)/10)+0x30);    
      delay(20);
  lcd.write(((sensorValue1-29)%10)+0x30);      
    delay(20);

  }
  }
Serial.print("E");
      Serial.write((sensorValue1/100)+0x30);    
      delay(20);
  Serial.write(((sensorValue1%100)/10)+0x30);    
      delay(20);
  Serial.write((sensorValue1%10)+0x30);      
    delay(20);
Serial.print('\n');    
}
}


void serialEvent()
{
  while (Serial.available())
  {
    // get the new byte:
    char inChar = (char)Serial.read();
    // add it to the inputString:

    // if the incoming character is a newline, set a flag
    // so the main loop can do something about it:



  }
}

Comments

Popular posts from this blog

PUNCHING MACHINE

ACCIDENT AVOIDING SYSTEM FOR PUNCHING MACHINE SYNOPSIS The aim of our project is to take a system-wide approach to preventing the machine accident. The system includes not just the machine and the operator; but rather, it includes everything from the initial design of the machine to the training of everyone that is responsible for any aspect of it, to the documentation of all changes, to regular safety audits and a finally a corporate culture of safety-first. Design is the part of a machine's life where the greatest impact can be made in relation to avoiding accidents. The designer should ensure that the machine is safe to set up and operate, safe to install, safe to maintain, safe to repair, and safe to decommission. Although safe operation is usually at the forefront of a designer's mind, safe maintenance and repair should also be a high priority. Around 50% of fatal accidents involving industrial equipment are associated with maintenance activities, and design...

garbage monitoring using arduino code with gsm

#include <SoftwareSerial.h> #include <LiquidCrystal.h> //LiquidCrystal lcd(7, 6, 5, 4, 3, 2); LiquidCrystal lcd(13, 12, 11, 10, 9, 8); SoftwareSerial mySerial(0,1); #define trigPin 2 #define echoPin 3 #define PIR_sensor 4 #define m11 5 #define m12 6 void setup() {    lcd.begin(16, 2);    lcd.print("    Garbage    ");    Serial.println("garbage ");   lcd.setCursor(0,1);   lcd.print("   Open Close    ");   Serial.println(" open close");   delay(3000);   lcd.clear();   //lcd.print(" ");   delay(2000); mySerial.begin(9600); // Setting the baud rate of GSM Module Serial.begin (9600); pinMode(trigPin, OUTPUT); pinMode(echoPin, INPUT);  pinMode(m11, OUTPUT);   pinMode(m12, OUTPUT);   } void loop() {  readPIR();  pingDist();  SendMessage(); } void pingDist ()   {     long duration, distance;...