Posts

Showing posts from March, 2019

Lab #5: Bio-Signals

Image
ECG Tutorial Heart rate from ECG in Arduino - sketch that acquires the ECG signal via one of the analog inputs #include "Wire.h" #include "Adafruit_LiquidCrystal.h" Adafruit_LiquidCrystal lcd(0); int pin = A0; int count = 0; void setup() {   Serial.begin(9600);  // put your setup code here, to run once:   pinMode(pin, OUTPUT);   lcd.begin(16,2); } void loop() {   // put your main code here, to run repeatedly: int now = millis(); while (millis() - now < 10000) {   int sensorValue = analogRead(pin);   Serial.println(sensorValue);   if (sensorValue > 116) {     count++;   }   }   int printed = count*6;   lcd.print(printed);   lcd.print("bpm");   delay(300);   lcd.clear();   count = 0; } - devise a procedure to calculate the heart rate from the acquired ECG signal - send the heart rate to the LCD Pulse Sensor Here is a screenshot of what the Pulse S...

Lab #6: Wireless Lab - IR and WiFi

Image
IR Receiver Our results printed to the Serial monitor after pressing 1, 2, and 3 on the remote. 1 - C9767F76 2 -C8155AB1 3 - B6996DAE 4 - 969AE844 5 -4AAFAC67 6 - 9C2A936C 7 - 833ED333 8 - 55F2B93 9 -DE78B0D0 0 -F32F72D7 Code for IR Receiver #include <IRremote.h> int RECV_PIN = 11; //IR Receiver connected to pin 11 int yellow = 3; int green = 4; IRrecv irrecv(RECV_PIN); decode_results results; void setup() {   Serial.begin(9600);   irrecv.enableIRIn(); // Start the receiver pinMode(yellow, OUTPUT); pinMode(green, OUTPUT); } void loop() {   results.value = 0x00;   if (irrecv.decode(&results)) { //if a code received     Serial.println(results.value, HEX); //displays in hexidecimal format    //pressing 1 on remote    if(results.value == 0x...