From 2f080d5f3a0730f29969ce32be6c06f9370960b4 Mon Sep 17 00:00:00 2001 From: Elfreda Kwawu <82907149+ekwawu@users.noreply.github.com> Date: Wed, 3 Apr 2024 11:21:54 -0400 Subject: [PATCH 01/52] Create app.js for phystrax --- apps/phystrax/app.js | 113 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 apps/phystrax/app.js diff --git a/apps/phystrax/app.js b/apps/phystrax/app.js new file mode 100644 index 000000000..4576a9114 --- /dev/null +++ b/apps/phystrax/app.js @@ -0,0 +1,113 @@ +let isMeasuring = false; +let currentHeartRate = null; +let lcdTimeout; +let logData = []; + +function startMeasure() { + isMeasuring = true; + Bangle.setLCDTimeout(0); + lcdTimeout = setTimeout(() => { + Bangle.setLCDTimeout(50); + }, 50000); + + setTimeout(() => { + Bangle.setHRMPower(1); + Bangle.on('HRM', handleHeartRate); + Bangle.beep(400, 1000); // Buzz to indicate measurement start + drawScreen(); + }, 500); +} + +function stopMeasure() { + isMeasuring = false; + clearTimeout(lcdTimeout); + Bangle.setLCDTimeout(10); + Bangle.setHRMPower(0); + Bangle.removeAllListeners('HRM'); + saveDataToCSV(); // Save data to CSV when measurement stops + Bangle.beep(400, 800); // Buzz to indicate measurement stop + drawScreen(); +} + +function handleHeartRate(hrm) { + if (hrm.confidence > 90) { + currentHeartRate = hrm.bpm; + var date = new Date(); + var dateStr = require("locale").date(date); + var timeStr = require("locale").time(date, 1); + var timestamp = dateStr + " " + timeStr; // Concatenate date and time + logData.push({ timestamp: timestamp, heartRate: currentHeartRate }); + drawScreen(); + } +} + + +function drawScreen(message) { + g.clear(); // Clear the display + + // Set the background color + g.setColor('#95E7FF'); + + // Fill the entire display with the background color + g.fillRect(0, 0, g.getWidth(), g.getHeight()); + + // Set font and alignment for drawing text + g.setFontAlign(0, 0); + g.setFont('Vector', 15); + + // Draw the title + g.setColor('#000000'); // Set text color to black + g.drawString('Heart Rate Monitor', g.getWidth() / 2, 10); + + if (isMeasuring) { + // Draw measuring status + g.setFont('6x8', 2); + g.drawString('Measuring...', g.getWidth() / 2, g.getHeight() / 2 - 10); + + // Draw current heart rate if available + g.setFont('6x8', 4); + if (currentHeartRate !== null) { + g.drawString(currentHeartRate.toString(), g.getWidth() / 2, g.getHeight() / 2 + 20); + g.setFont('6x8', 1.6); + g.drawString(' BPM', g.getWidth() / 2 + 42, g.getHeight() / 2 + 20); + } + + // Draw instructions + g.setFont('6x8', 1.5); + g.drawString('Press button to stop', g.getWidth() / 2, g.getHeight() / 2 + 42); + } else { + // Draw last heart rate + g.setFont('Vector', 12); + g.drawString('Last Heart Rate:', g.getWidth() / 2, g.getHeight() / 2 - 20); + if (currentHeartRate !== null && currentHeartRate > 0) { + g.setFont('6x8', 4); + g.drawString(currentHeartRate.toString(), g.getWidth() / 2, g.getHeight() / 2 + 10); + } else { + g.setFont('6x8', 2); + g.drawString('No data', g.getWidth() / 2, g.getHeight() / 2 + 10); + g.setFont('6x8', 1); + g.drawString(message || 'Press button to start', g.getWidth() / 2, g.getHeight() / 2 + 30); + } + } + + // Update the display + g.flip(); +} + +function saveDataToCSV() { + let csvContent = "Timestamp,Heart Rate\n"; + logData.forEach(entry => { + csvContent += `${entry.timestamp},${entry.heartRate}\n`; + }); + require("Storage").write("heart_rate_data.csv", csvContent); +} + +setWatch(function() { + if (!isMeasuring) { + startMeasure(); + } else { + stopMeasure(); + } +}, BTN1, { repeat: true, edge: 'rising' }); + +drawScreen(); From 53e3fb49825b9f5625b403be94b588013616f5db Mon Sep 17 00:00:00 2001 From: Elfreda Kwawu <82907149+ekwawu@users.noreply.github.com> Date: Wed, 3 Apr 2024 11:31:10 -0400 Subject: [PATCH 02/52] Create app-icon.js --- apps/phystrax/app-icon.js | 1 + 1 file changed, 1 insertion(+) create mode 100644 apps/phystrax/app-icon.js diff --git a/apps/phystrax/app-icon.js b/apps/phystrax/app-icon.js new file mode 100644 index 000000000..46faf7ecc --- /dev/null +++ b/apps/phystrax/app-icon.js @@ -0,0 +1 @@ +require("heatshrink").decompress(atob("mUywZC/AB9JkmQA4mSpMgCAsCCIILBCIoIBoARIEwYRDAQI1FBYdIgESBAoRChIIEAQIsFIIcBCIwCIwEACJ5fCBAkgChRTGMQw4FQApQLBYtAggRJpA+MARZKLRLDdHKBUEZY4CGyEJkEQcwOQX5hKBAQI7BBw9BGoUAEYJKBAoIjHUIUggAmCTAKGDFgQOCAAMCgIgBYQIFBBYawCR4IABGoMCOIOQhEEBYaPDXIhxBiQjCOgQCBHYJTDyA1BwAmCOIwpEBwIsBEwNANARcEEAIFCKYJNBAoLsHRgxHCZAxiFBAb+JAALRFI4puDAARlFUIRuGHA+CCIy/DHAwCHCIgyIQAwADTAYRNTA6SGAAo4ICJCkMAAzdBUhIAGL4tICJSGFCJsAhLIHABQRRQwLaFABbaGAFAA==")) From 2fef0c63782a35a888e54e964c0b56ab3afbe484 Mon Sep 17 00:00:00 2001 From: Elfreda Kwawu <82907149+ekwawu@users.noreply.github.com> Date: Wed, 3 Apr 2024 11:41:36 -0400 Subject: [PATCH 03/52] Create metadata.json --- apps/phystrax/metadata.json | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 apps/phystrax/metadata.json diff --git a/apps/phystrax/metadata.json b/apps/phystrax/metadata.json new file mode 100644 index 000000000..589da2e59 --- /dev/null +++ b/apps/phystrax/metadata.json @@ -0,0 +1,15 @@ +{ "id": "phystrax", + "name": "PhysTrax App", + "shortName":"PhysTrax", + "version":"0.01", + "description": "Tracking physiological measurements to support acticve learning in classrooms", + "icon": "app.png", + "tags": "", + "supports" : ["BANGLEJS2"], + "readme": "README.md", + "interface": "interface.html", + "storage": [ + {"name":"heartrate.app.js","url":"app.js"}, + {"name":"heartrate.img","url":"app-icon.js","evaluate":true} + ] +} From 19fa4a94b6369de282ed8460488175e9592c4049 Mon Sep 17 00:00:00 2001 From: Elfreda Kwawu <82907149+ekwawu@users.noreply.github.com> Date: Wed, 3 Apr 2024 11:45:34 -0400 Subject: [PATCH 04/52] Create interface.html --- apps/phystrax/interface.html | 65 ++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 apps/phystrax/interface.html diff --git a/apps/phystrax/interface.html b/apps/phystrax/interface.html new file mode 100644 index 000000000..4e048b686 --- /dev/null +++ b/apps/phystrax/interface.html @@ -0,0 +1,65 @@ + +
+ + + + + + + + + + + From 16f3ec337fd09ac59d58ec43e6b0d8129fb3000a Mon Sep 17 00:00:00 2001 From: Elfreda Kwawu <82907149+ekwawu@users.noreply.github.com> Date: Wed, 3 Apr 2024 11:57:00 -0400 Subject: [PATCH 05/52] Update metadata.json --- apps/phystrax/metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/phystrax/metadata.json b/apps/phystrax/metadata.json index 589da2e59..646d51eb8 100644 --- a/apps/phystrax/metadata.json +++ b/apps/phystrax/metadata.json @@ -10,6 +10,6 @@ "interface": "interface.html", "storage": [ {"name":"heartrate.app.js","url":"app.js"}, - {"name":"heartrate.img","url":"app-icon.js","evaluate":true} + {"name":"app.png","url":"app-icon.js","evaluate":true} ] } From 331e143e0af4f87ed6fbf1c423bf1559056f5432 Mon Sep 17 00:00:00 2001 From: Elfreda Kwawu <82907149+ekwawu@users.noreply.github.com> Date: Wed, 3 Apr 2024 11:57:17 -0400 Subject: [PATCH 06/52] Update metadata.json --- apps/phystrax/metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/phystrax/metadata.json b/apps/phystrax/metadata.json index 646d51eb8..ee97cb1b0 100644 --- a/apps/phystrax/metadata.json +++ b/apps/phystrax/metadata.json @@ -2,7 +2,7 @@ "name": "PhysTrax App", "shortName":"PhysTrax", "version":"0.01", - "description": "Tracking physiological measurements to support acticve learning in classrooms", + "description": "Tracking physiological measurements to support active learning in classrooms", "icon": "app.png", "tags": "", "supports" : ["BANGLEJS2"], From 83437f6e3933a0edcd9dac4f5876ffcf145172b4 Mon Sep 17 00:00:00 2001 From: Elfreda Kwawu <82907149+ekwawu@users.noreply.github.com> Date: Wed, 3 Apr 2024 12:01:57 -0400 Subject: [PATCH 07/52] Create README.md --- apps/phystrax/README.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 apps/phystrax/README.md diff --git a/apps/phystrax/README.md b/apps/phystrax/README.md new file mode 100644 index 000000000..ca8df74b7 --- /dev/null +++ b/apps/phystrax/README.md @@ -0,0 +1,8 @@ +# CapstoneWearable +Research has shown that active learning approaches in classrooms, which emphasize the construction of knowledge and reflection on the learning process, significantly enhance the student learning experience and lead to better success in the classroom. The Active Learning Initiative at the University of Georgia focuses on instructor development, student engagement, and classroom enhancement. + +This project focuses specifically on classroom enhancement to create a device that will enhance the learning experience of students in physiology classes by allowing them to learn about and analyze their physiological patterns. The project must adhere to the constraints of a one-hundred dollar per watch budget, the ability to be scaled to a classroom of three-hundred twenty students, and provide data with at least 80% accuracy. By giving students access to their heart rate (HR) and heart rate variability (HRV) data, the goal is that students can better understand the function of the heart as well as the physiological conditions that can be affected by the heart. The original concept was to develop a wrist-wearable, screen-less device featuring sensors that detect a user’s heart rate by emitting LEDs that detect the expansion of blood vessels in the wrist and the quantity of light transmitted in the vascular bed to obtain heart rate and blood oxygen data and the heart rate variability calculated using an algorithm that takes the root-mean-square of interbeat intervals between successive heartbeats. + +After prototyping this custom device and testing its efficacy, the accuracy of the data produced by the sensor was not within the accuracy criteria, and the decision was made to pivot to an existing on-market device coupled with custom software to meet the needs of the client. The analysis software created for the device allows the students to analyze their physiological data and permits for their instructor to access their data anonymously. The data, coupled with survey data entered by the students daily, provides insight into the effect of variables such as sleep, exercise, and caffeine intake to analyze the effects that these have on their physiological measurements. To evaluate the device's efficacy in achieving the goal of 80% accuracy, the wrist wearable device was tested on several different skin tones doing various activities and measuring data over varying intervals and then compared against the data of Apple Watches. + +This project resulted in the creation of a custom data analysis software for the use of students on a Bangle.js smartwatch device that can be continually developed in the future to reach the goal of an inexpensive, easy-to-use device for students to use in active learning classrooms to enhance their understanding of physiology by analyzing their own physiological data in class. From 2f6a6dc906fcbf953a2e175d47ef97963fad8a59 Mon Sep 17 00:00:00 2001 From: Elfreda Kwawu <82907149+ekwawu@users.noreply.github.com> Date: Wed, 3 Apr 2024 12:05:27 -0400 Subject: [PATCH 08/52] Add files via upload --- apps/phystrax/app.png | Bin 0 -> 1299 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 apps/phystrax/app.png diff --git a/apps/phystrax/app.png b/apps/phystrax/app.png new file mode 100644 index 0000000000000000000000000000000000000000..5fd69c6de8f3e7b00e4eb089a4e933d80116a6bf GIT binary patch literal 1299 zcmV+u1?>8XP);`x1Xsi$3y|F^>3y^?m@~>$+fWb(qOQaH)0t5Ugq4mDQ!*8crna?fAa~9-rt8A&g zKQirorS7oLt}4kRL!$hdPTr8BnF84$-!}l*$-Qfz+hn_h9W6Qzil^dQ<9Q1V`Ev;% z+r5yy$Hg0xnc_9Ee*O8 |~#}le@6FW^8ek5KCDqjDW@Voo(_tRjXYs@5I^C_m_7Xw_d9)=>T1q zuEGt%_gC5l|E2}FptWn3MV@4_W~%}WCR<#Yyg(%DOq0*Lj9u>lVt{wj*1pX#7AGaN zn(wvrX_9`^;npBkJaO^``^?tZ0KUH_+PLu?o8`WkDYWXf+7gGegE&f>qJfW{V1NxN z1H6~MCk4@dze|%xqRpGnl2emrtpW}u3qKyy_aDx+$br4>!e_aoS3XO5WUS?WT;b(Y zyby;KsoGgkwy9FcGDDF6O!G#{!f!cP;Y3K@Dd$XW?(dF6N2y*}7gpzB%LIm^Ah@{I zn_XYP&KVb$WT9>j&e|wH5bIgD?(FyzSS*<<*M!;Dn1?%_Z;7R|Zjh2zCFSA%5+IIC zwwx6rHG#)652n 8G7^turZypqvkajPQzRpH(sU+)ScwrCJ6wAH-Z!G@#W z-b)>u(Qfp<(amZ9sW2xC)@y}_M+Q$ssrr*026(ALi0!!{(ju`hTguZ2(2&aSl_8S$ zH2M2!fH>mP8Rrt&muTS2(jb75WUo`Y*hX+$ktd5**T8H)+m$9psoM?kQvo1j$-cfa ziO+n=mu)wi1!8y9({qtGS0q&G{%+35 Date: Wed, 3 Apr 2024 12:08:42 -0400 Subject: [PATCH 09/52] Update metadata.json --- apps/phystrax/metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/phystrax/metadata.json b/apps/phystrax/metadata.json index ee97cb1b0..f23405aed 100644 --- a/apps/phystrax/metadata.json +++ b/apps/phystrax/metadata.json @@ -4,7 +4,7 @@ "version":"0.01", "description": "Tracking physiological measurements to support active learning in classrooms", "icon": "app.png", - "tags": "", + "tags": "health", "supports" : ["BANGLEJS2"], "readme": "README.md", "interface": "interface.html", From 7b9e4b7f29c127bd0504095e173f4c7c54b7a19e Mon Sep 17 00:00:00 2001 From: Elfreda Kwawu <82907149+ekwawu@users.noreply.github.com> Date: Wed, 3 Apr 2024 12:42:13 -0400 Subject: [PATCH 10/52] Update metadata.json --- apps/phystrax/metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/phystrax/metadata.json b/apps/phystrax/metadata.json index f23405aed..04585e0d1 100644 --- a/apps/phystrax/metadata.json +++ b/apps/phystrax/metadata.json @@ -9,7 +9,7 @@ "readme": "README.md", "interface": "interface.html", "storage": [ - {"name":"heartrate.app.js","url":"app.js"}, + {"name":"phystrax.app.js","url":"app.js"}, {"name":"app.png","url":"app-icon.js","evaluate":true} ] } From 780b95306a92630ee5b24ec07c0b5f4419717e8a Mon Sep 17 00:00:00 2001 From: Elfreda Kwawu <82907149+ekwawu@users.noreply.github.com> Date: Wed, 3 Apr 2024 12:50:28 -0400 Subject: [PATCH 11/52] Update metadata.json --- apps/phystrax/metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/phystrax/metadata.json b/apps/phystrax/metadata.json index 04585e0d1..a71fc8aa0 100644 --- a/apps/phystrax/metadata.json +++ b/apps/phystrax/metadata.json @@ -10,6 +10,6 @@ "interface": "interface.html", "storage": [ {"name":"phystrax.app.js","url":"app.js"}, - {"name":"app.png","url":"app-icon.js","evaluate":true} + {"name":"app.img","url":"app-icon.js","evaluate":true} ] } From 50bdb6fe5557aceb2306fb0ffbaaa132f2a59c5e Mon Sep 17 00:00:00 2001 From: Elfreda Kwawu <82907149+ekwawu@users.noreply.github.com> Date: Thu, 4 Apr 2024 14:52:53 -0400 Subject: [PATCH 12/52] Update metadata.json for icon --- apps/phystrax/metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/phystrax/metadata.json b/apps/phystrax/metadata.json index a71fc8aa0..4feeb6f16 100644 --- a/apps/phystrax/metadata.json +++ b/apps/phystrax/metadata.json @@ -10,6 +10,6 @@ "interface": "interface.html", "storage": [ {"name":"phystrax.app.js","url":"app.js"}, - {"name":"app.img","url":"app-icon.js","evaluate":true} + {"name":"app-icon.js","url":"app-icon.js","evaluate":true} ] } From d68efc5287748b049b6a2b678c73b7e3a6aa533c Mon Sep 17 00:00:00 2001 From: Elfreda Kwawu <82907149+ekwawu@users.noreply.github.com> Date: Thu, 4 Apr 2024 15:29:31 -0400 Subject: [PATCH 14/52] Update app.js --- apps/phystrax/app.js | 1 - 1 file changed, 1 deletion(-) diff --git a/apps/phystrax/app.js b/apps/phystrax/app.js index 4576a9114..e6566aa26 100644 --- a/apps/phystrax/app.js +++ b/apps/phystrax/app.js @@ -71,7 +71,6 @@ function drawScreen(message) { g.setFont('6x8', 1.6); g.drawString(' BPM', g.getWidth() / 2 + 42, g.getHeight() / 2 + 20); } - // Draw instructions g.setFont('6x8', 1.5); g.drawString('Press button to stop', g.getWidth() / 2, g.getHeight() / 2 + 42); From 409fa3abceb16813adef4980be9e0d4ecdf89245 Mon Sep 17 00:00:00 2001 From: Elfreda Kwawu <82907149+ekwawu@users.noreply.github.com> Date: Thu, 4 Apr 2024 15:32:44 -0400 Subject: [PATCH 15/52] Update metadata.json --- apps/phystrax/metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/phystrax/metadata.json b/apps/phystrax/metadata.json index 4feeb6f16..d5b204c69 100644 --- a/apps/phystrax/metadata.json +++ b/apps/phystrax/metadata.json @@ -3,7 +3,7 @@ "shortName":"PhysTrax", "version":"0.01", "description": "Tracking physiological measurements to support active learning in classrooms", - "icon": "app.png", + "icon": "BangleApps/apps/phystrax/app.png", "tags": "health", "supports" : ["BANGLEJS2"], "readme": "README.md", From 7f3fc665581f3d899091427ffc6a524211c39cd3 Mon Sep 17 00:00:00 2001 From: Elfreda Kwawu <82907149+ekwawu@users.noreply.github.com> Date: Thu, 4 Apr 2024 15:37:21 -0400 Subject: [PATCH 16/52] Update metadata.json --- apps/phystrax/metadata.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/phystrax/metadata.json b/apps/phystrax/metadata.json index d5b204c69..6ef02ec1a 100644 --- a/apps/phystrax/metadata.json +++ b/apps/phystrax/metadata.json @@ -1,9 +1,10 @@ { "id": "phystrax", - "name": "PhysTrax App", + "name": "PhysTrax", + "entry": "app.js", "shortName":"PhysTrax", "version":"0.01", "description": "Tracking physiological measurements to support active learning in classrooms", - "icon": "BangleApps/apps/phystrax/app.png", + "icon": "app.png", "tags": "health", "supports" : ["BANGLEJS2"], "readme": "README.md", From 6785717aa8c93e3c74cb8b5907038cfab4b0cd03 Mon Sep 17 00:00:00 2001 From: Elfreda Kwawu <82907149+ekwawu@users.noreply.github.com> Date: Thu, 4 Apr 2024 15:43:11 -0400 Subject: [PATCH 17/52] Update metadata.json --- apps/phystrax/metadata.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/apps/phystrax/metadata.json b/apps/phystrax/metadata.json index 6ef02ec1a..6117b74f6 100644 --- a/apps/phystrax/metadata.json +++ b/apps/phystrax/metadata.json @@ -1,6 +1,5 @@ { "id": "phystrax", "name": "PhysTrax", - "entry": "app.js", "shortName":"PhysTrax", "version":"0.01", "description": "Tracking physiological measurements to support active learning in classrooms", @@ -11,6 +10,6 @@ "interface": "interface.html", "storage": [ {"name":"phystrax.app.js","url":"app.js"}, - {"name":"app-icon.js","url":"app-icon.js","evaluate":true} + {"name":"app-icon.img","url":"app-icon.js","evaluate":true} ] } From e411db0eec9f5fc8994ab1028d6dc0ac954ba804 Mon Sep 17 00:00:00 2001 From: Elfreda Kwawu Date: Thu, 4 Apr 2024 16:25:02 -0400 Subject: [PATCH 18/52] added seconds --- apps/phystrax/app.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/phystrax/app.js b/apps/phystrax/app.js index e6566aa26..d5c8f4e8c 100644 --- a/apps/phystrax/app.js +++ b/apps/phystrax/app.js @@ -35,13 +35,13 @@ function handleHeartRate(hrm) { var date = new Date(); var dateStr = require("locale").date(date); var timeStr = require("locale").time(date, 1); - var timestamp = dateStr + " " + timeStr; // Concatenate date and time + var seconds = ('0' + date.getSeconds()).slice(-2); // Get seconds and pad with leading zero if necessary + var timestamp = dateStr + " " + timeStr + ":" + seconds; // Concatenate date, time, and seconds logData.push({ timestamp: timestamp, heartRate: currentHeartRate }); drawScreen(); } } - function drawScreen(message) { g.clear(); // Clear the display From b36fba55f11c18c0191c893e162d52bcbcca5e46 Mon Sep 17 00:00:00 2001 From: Elfreda Kwawu <82907149+ekwawu@users.noreply.github.com> Date: Thu, 4 Apr 2024 17:06:34 -0400 Subject: [PATCH 19/52] Update interface.html --- apps/phystrax/interface.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/phystrax/interface.html b/apps/phystrax/interface.html index 4e048b686..d1191ef8d 100644 --- a/apps/phystrax/interface.html +++ b/apps/phystrax/interface.html @@ -41,12 +41,12 @@ function getData() { }); } -// You can call a utility function to save the data +// Call a utility function to save the data document.getElementById("btnSave").addEventListener("click", function() { Util.saveCSV("heart_rate_data", csvData); }); -// Or you can also delete the file +// Or delete the file document.getElementById("btnDelete").addEventListener("click", function() { Util.showModal("Deleting..."); Util.eraseStorageFile("heart_rate_data.csv", function() { From fdbe704d898cc04a5dd58716ba114762acbfefef Mon Sep 17 00:00:00 2001 From: Elfreda Kwawu <82907149+ekwawu@users.noreply.github.com> Date: Thu, 4 Apr 2024 17:12:55 -0400 Subject: [PATCH 20/52] Update interface.html for testing purposes --- apps/phystrax/interface.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/phystrax/interface.html b/apps/phystrax/interface.html index d1191ef8d..56f091744 100644 --- a/apps/phystrax/interface.html +++ b/apps/phystrax/interface.html @@ -23,7 +23,7 @@ function getData() { Util.hideModal(); // If no data, report it and exit if (data.length === 0) { - dataElement.innerHTML = "No data found"; + dataElement.innerHTML = "There is no data"; return; } // Otherwise parse the data and output it as a table From b7e40d446fdd01a7d1ce3fe0b6ded4be90146479 Mon Sep 17 00:00:00 2001 From: Elfreda Kwawu <82907149+ekwawu@users.noreply.github.com> Date: Fri, 5 Apr 2024 22:02:47 -0400 Subject: [PATCH 21/52] testing for app loader integration --- apps/phystrax/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/phystrax/app.js b/apps/phystrax/app.js index d5c8f4e8c..e5a7c9da7 100644 --- a/apps/phystrax/app.js +++ b/apps/phystrax/app.js @@ -62,7 +62,7 @@ function drawScreen(message) { if (isMeasuring) { // Draw measuring status g.setFont('6x8', 2); - g.drawString('Measuring...', g.getWidth() / 2, g.getHeight() / 2 - 10); + g.drawString('Measuring..', g.getWidth() / 2, g.getHeight() / 2 - 10); // Draw current heart rate if available g.setFont('6x8', 4); From 6d5bcd72a01530f1d5b465e6d0f2841037183d1d Mon Sep 17 00:00:00 2001 From: Elfreda Kwawu <82907149+ekwawu@users.noreply.github.com> Date: Fri, 5 Apr 2024 22:30:36 -0400 Subject: [PATCH 22/52] Delete apps/phystrax directory --- apps/phystrax/README.md | 8 --- apps/phystrax/app-icon.js | 1 - apps/phystrax/app.js | 112 ----------------------------------- apps/phystrax/app.png | Bin 1299 -> 0 bytes apps/phystrax/interface.html | 65 -------------------- apps/phystrax/metadata.json | 15 ----- 6 files changed, 201 deletions(-) delete mode 100644 apps/phystrax/README.md delete mode 100644 apps/phystrax/app-icon.js delete mode 100644 apps/phystrax/app.js delete mode 100644 apps/phystrax/app.png delete mode 100644 apps/phystrax/interface.html delete mode 100644 apps/phystrax/metadata.json diff --git a/apps/phystrax/README.md b/apps/phystrax/README.md deleted file mode 100644 index ca8df74b7..000000000 --- a/apps/phystrax/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# CapstoneWearable -Research has shown that active learning approaches in classrooms, which emphasize the construction of knowledge and reflection on the learning process, significantly enhance the student learning experience and lead to better success in the classroom. The Active Learning Initiative at the University of Georgia focuses on instructor development, student engagement, and classroom enhancement. - -This project focuses specifically on classroom enhancement to create a device that will enhance the learning experience of students in physiology classes by allowing them to learn about and analyze their physiological patterns. The project must adhere to the constraints of a one-hundred dollar per watch budget, the ability to be scaled to a classroom of three-hundred twenty students, and provide data with at least 80% accuracy. By giving students access to their heart rate (HR) and heart rate variability (HRV) data, the goal is that students can better understand the function of the heart as well as the physiological conditions that can be affected by the heart. The original concept was to develop a wrist-wearable, screen-less device featuring sensors that detect a user’s heart rate by emitting LEDs that detect the expansion of blood vessels in the wrist and the quantity of light transmitted in the vascular bed to obtain heart rate and blood oxygen data and the heart rate variability calculated using an algorithm that takes the root-mean-square of interbeat intervals between successive heartbeats. - -After prototyping this custom device and testing its efficacy, the accuracy of the data produced by the sensor was not within the accuracy criteria, and the decision was made to pivot to an existing on-market device coupled with custom software to meet the needs of the client. The analysis software created for the device allows the students to analyze their physiological data and permits for their instructor to access their data anonymously. The data, coupled with survey data entered by the students daily, provides insight into the effect of variables such as sleep, exercise, and caffeine intake to analyze the effects that these have on their physiological measurements. To evaluate the device's efficacy in achieving the goal of 80% accuracy, the wrist wearable device was tested on several different skin tones doing various activities and measuring data over varying intervals and then compared against the data of Apple Watches. - -This project resulted in the creation of a custom data analysis software for the use of students on a Bangle.js smartwatch device that can be continually developed in the future to reach the goal of an inexpensive, easy-to-use device for students to use in active learning classrooms to enhance their understanding of physiology by analyzing their own physiological data in class. diff --git a/apps/phystrax/app-icon.js b/apps/phystrax/app-icon.js deleted file mode 100644 index 46faf7ecc..000000000 --- a/apps/phystrax/app-icon.js +++ /dev/null @@ -1 +0,0 @@ -require("heatshrink").decompress(atob("mUywZC/AB9JkmQA4mSpMgCAsCCIILBCIoIBoARIEwYRDAQI1FBYdIgESBAoRChIIEAQIsFIIcBCIwCIwEACJ5fCBAkgChRTGMQw4FQApQLBYtAggRJpA+MARZKLRLDdHKBUEZY4CGyEJkEQcwOQX5hKBAQI7BBw9BGoUAEYJKBAoIjHUIUggAmCTAKGDFgQOCAAMCgIgBYQIFBBYawCR4IABGoMCOIOQhEEBYaPDXIhxBiQjCOgQCBHYJTDyA1BwAmCOIwpEBwIsBEwNANARcEEAIFCKYJNBAoLsHRgxHCZAxiFBAb+JAALRFI4puDAARlFUIRuGHA+CCIy/DHAwCHCIgyIQAwADTAYRNTA6SGAAo4ICJCkMAAzdBUhIAGL4tICJSGFCJsAhLIHABQRRQwLaFABbaGAFAA==")) diff --git a/apps/phystrax/app.js b/apps/phystrax/app.js deleted file mode 100644 index e5a7c9da7..000000000 --- a/apps/phystrax/app.js +++ /dev/null @@ -1,112 +0,0 @@ -let isMeasuring = false; -let currentHeartRate = null; -let lcdTimeout; -let logData = []; - -function startMeasure() { - isMeasuring = true; - Bangle.setLCDTimeout(0); - lcdTimeout = setTimeout(() => { - Bangle.setLCDTimeout(50); - }, 50000); - - setTimeout(() => { - Bangle.setHRMPower(1); - Bangle.on('HRM', handleHeartRate); - Bangle.beep(400, 1000); // Buzz to indicate measurement start - drawScreen(); - }, 500); -} - -function stopMeasure() { - isMeasuring = false; - clearTimeout(lcdTimeout); - Bangle.setLCDTimeout(10); - Bangle.setHRMPower(0); - Bangle.removeAllListeners('HRM'); - saveDataToCSV(); // Save data to CSV when measurement stops - Bangle.beep(400, 800); // Buzz to indicate measurement stop - drawScreen(); -} - -function handleHeartRate(hrm) { - if (hrm.confidence > 90) { - currentHeartRate = hrm.bpm; - var date = new Date(); - var dateStr = require("locale").date(date); - var timeStr = require("locale").time(date, 1); - var seconds = ('0' + date.getSeconds()).slice(-2); // Get seconds and pad with leading zero if necessary - var timestamp = dateStr + " " + timeStr + ":" + seconds; // Concatenate date, time, and seconds - logData.push({ timestamp: timestamp, heartRate: currentHeartRate }); - drawScreen(); - } -} - -function drawScreen(message) { - g.clear(); // Clear the display - - // Set the background color - g.setColor('#95E7FF'); - - // Fill the entire display with the background color - g.fillRect(0, 0, g.getWidth(), g.getHeight()); - - // Set font and alignment for drawing text - g.setFontAlign(0, 0); - g.setFont('Vector', 15); - - // Draw the title - g.setColor('#000000'); // Set text color to black - g.drawString('Heart Rate Monitor', g.getWidth() / 2, 10); - - if (isMeasuring) { - // Draw measuring status - g.setFont('6x8', 2); - g.drawString('Measuring..', g.getWidth() / 2, g.getHeight() / 2 - 10); - - // Draw current heart rate if available - g.setFont('6x8', 4); - if (currentHeartRate !== null) { - g.drawString(currentHeartRate.toString(), g.getWidth() / 2, g.getHeight() / 2 + 20); - g.setFont('6x8', 1.6); - g.drawString(' BPM', g.getWidth() / 2 + 42, g.getHeight() / 2 + 20); - } - // Draw instructions - g.setFont('6x8', 1.5); - g.drawString('Press button to stop', g.getWidth() / 2, g.getHeight() / 2 + 42); - } else { - // Draw last heart rate - g.setFont('Vector', 12); - g.drawString('Last Heart Rate:', g.getWidth() / 2, g.getHeight() / 2 - 20); - if (currentHeartRate !== null && currentHeartRate > 0) { - g.setFont('6x8', 4); - g.drawString(currentHeartRate.toString(), g.getWidth() / 2, g.getHeight() / 2 + 10); - } else { - g.setFont('6x8', 2); - g.drawString('No data', g.getWidth() / 2, g.getHeight() / 2 + 10); - g.setFont('6x8', 1); - g.drawString(message || 'Press button to start', g.getWidth() / 2, g.getHeight() / 2 + 30); - } - } - - // Update the display - g.flip(); -} - -function saveDataToCSV() { - let csvContent = "Timestamp,Heart Rate\n"; - logData.forEach(entry => { - csvContent += `${entry.timestamp},${entry.heartRate}\n`; - }); - require("Storage").write("heart_rate_data.csv", csvContent); -} - -setWatch(function() { - if (!isMeasuring) { - startMeasure(); - } else { - stopMeasure(); - } -}, BTN1, { repeat: true, edge: 'rising' }); - -drawScreen(); diff --git a/apps/phystrax/app.png b/apps/phystrax/app.png deleted file mode 100644 index 5fd69c6de8f3e7b00e4eb089a4e933d80116a6bf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1299 zcmV+u1?>8XP) YDOK64;+c;hzlVG5|xa)NkqrN3F+y3E3xEM zZnc%3p6T25NDVRviiWPLbMJS~x#ygFyFG7S=4D=TOM|@8kWXoHj{){;azc}#CjZdD zH=5iL`u^HzVBic_ozd#mXNKehntWB0qp>c=Iw$NHGFE>h2yVy?5CZoa@;gIDP8V=U zEA>be1Pf;aFu 6dU@4e!4g6iSUPF$x4Ks v(&W%75Fv0^4rRmQO$~fh1x)Ds zYyR^FIhq6HA?wji6?x_BlPQtBE{~!{5Zo+!j8e<005LKLrLOl3xh1nTfTKzAi-O=> z4IHls<_RxPY-?a7z19qHpb8L8ekg ;`x1Xsi$3y|F^>3y^?m@~>$+fWb(qOQaH)0t5Ugq4mDQ!*8crna?fAa~9-rt8A&g zKQirorS7oLt}4kRL!$hdPTr8BnF84$-!}l*$-Qfz+hn_h9W6Qzil^dQ<9Q1V`Ev;% z+r5yy$Hg0xnc_9Ee*O8 |~#}le@6FW^8ek5KCDqjDW@Voo(_tRjXYs@5I^C_m_7Xw_d9)=>T1q zuEGt%_gC5l|E2}FptWn3MV@4_W~%}WCR<#Yyg(%DOq0*Lj9u>lVt{wj*1pX#7AGaN zn(wvrX_9`^;npBkJaO^``^?tZ0KUH_+PLu?o8`WkDYWXf+7gGegE&f>qJfW{V1NxN z1H6~MCk4@dze|%xqRpGnl2emrtpW}u3qKyy_aDx+$br4>!e_aoS3XO5WUS?WT;b(Y zyby;KsoGgkwy9FcGDDF6O!G#{!f!cP;Y3K@Dd$XW?(dF6N2y*}7gpzB%LIm^Ah@{I zn_XYP&KVb$WT9>j&e|wH5bIgD?(FyzSS*<<*M!;Dn1?%_Z;7R|Zjh2zCFSA%5+IIC zwwx6rHG#)652n 8G7^turZypqvkajPQzRpH(sU+)ScwrCJ6wAH-Z!G@#W z-b)>u(Qfp<(amZ9sW2xC)@y}_M+Q$ssrr*026(ALi0!!{(ju`hTguZ2(2&aSl_8S$ zH2M2!fH>mP8Rrt&muTS2(jb75WUo`Y*hX+$ktd5**T8H)+m$9psoM?kQvo1j$-cfa ziO+n=mu)wi1!8y9({qtGS0q&G{%+35 - - - - - - - - - - - -