Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <LiquidCrystal.h>
- LiquidCrystal lcd(12,11,5,4,3,2);
- int a = 0;
- int celsius;
- int pulseRate;
- void setup(){
- Serial.begin(1156200);
- Serial.flush();
- lcd.begin(16,2);
- lcd.clear();
- //lcd.setCursor(0,0);
- //lcd.print("Arduino Serial");
- //lcd.setCursor(0,1);
- //lcd.print("on pin 0/1");
- // delay(1000);
- // lcd.clear();
- //randomSeed(analogRead(0));
- //lcd.setCursor(0,0);
- // lcd.print("Data sent");
- /* left side sensor for Temperature sensor*/
- pinMode(A0, INPUT); // connected with analog pin A1
- /* Right side sensor for Pulse rate sensor*/
- pinMode(A1, INPUT); // connected with analog pin A1
- /*Buzzer*/
- pinMode(8, OUTPUT);
- }
- void loop(){
- int randomChar = random(256);
- pulseRate = map(((analogRead(A1) - 20) * 3.04), 0, 1023, -40, 125);
- celsius = map(((analogRead(A0) - 20) * 3.04), 0, 1023, -40, 125);
- //because i have converte temperature seonsor to pulse rate
- // temp senseor value start from -40 to 125 degree celsius
- pulseRate +=40;
- lcd.setCursor(0,0);
- lcd.print("Temperature:");
- lcd.setCursor(12,0);
- lcd.print(celsius);
- lcd.setCursor(0,1);
- lcd.print("Pulse Rate:");
- lcd.setCursor(12,1);
- lcd.print(pulseRate);
- if((pulseRate<60 || pulseRate > 120) || (celsius < 30 || celsius > 37)){
- tone(8, 1000);
- delay(1000);
- noTone(8);
- //delay(1000);
- Serial.write("Patient trouble");
- }
- String x = "aa";
- Serial.println();
- if(a ==0){
- //Serial.write(celsius);
- a =1;
- //delay(3000);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement