{"id":2442,"date":"2022-03-31T19:12:21","date_gmt":"2022-03-31T23:12:21","guid":{"rendered":"https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/?p=2442"},"modified":"2022-04-04T16:10:30","modified_gmt":"2022-04-04T20:10:30","slug":"room-indicator-for-the-blind","status":"publish","type":"post","link":"https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/?p=2442","title":{"rendered":"Room Indicator for the Blind"},"content":{"rendered":"<h2>Description:<\/h2>\n<p>The purpose of this device is to assist people in locating themselves when they enter a new room in their home or other location. The basic idea is that when someone enters a room, a speaker will relay what room they are entering. This is accomplished by tracking the user&#8217;s position within a house through IR break beam sensors. One set of IR break beams is installed at each doorway or opening where the user can transition from room to room. When a break is detected in one of the beams, the system checks the current sensor being tripped against the previous room the user was in and adjusts the current room accordingly. Additionally, each room has its own sound that plays indicating to the user what room they are entering upon walking in. Finally, the system sends the current room number to a p5.js script that shows a visual layout of the floor plan with the current room highlighted in green.<\/p>\n<h2>Images:<\/h2>\n<p><img loading=\"lazy\" class=\"alignnone size-full wp-image-2446\" src=\"https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/wp-content\/uploads\/2022\/03\/IMG_0798-scaled.jpeg\" alt=\"\" width=\"1920\" height=\"2560\" srcset=\"https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/wp-content\/uploads\/2022\/03\/IMG_0798-scaled.jpeg 1920w, https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/wp-content\/uploads\/2022\/03\/IMG_0798-225x300.jpeg 225w, https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/wp-content\/uploads\/2022\/03\/IMG_0798-768x1024.jpeg 768w, https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/wp-content\/uploads\/2022\/03\/IMG_0798-1152x1536.jpeg 1152w, https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/wp-content\/uploads\/2022\/03\/IMG_0798-1536x2048.jpeg 1536w, https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/wp-content\/uploads\/2022\/03\/IMG_0798-1200x1600.jpeg 1200w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/> <img loading=\"lazy\" class=\"alignnone size-full wp-image-2447\" src=\"https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/wp-content\/uploads\/2022\/03\/IMG_0799-scaled.jpeg\" alt=\"\" width=\"1920\" height=\"2560\" srcset=\"https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/wp-content\/uploads\/2022\/03\/IMG_0799-scaled.jpeg 1920w, https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/wp-content\/uploads\/2022\/03\/IMG_0799-225x300.jpeg 225w, https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/wp-content\/uploads\/2022\/03\/IMG_0799-768x1024.jpeg 768w, https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/wp-content\/uploads\/2022\/03\/IMG_0799-1152x1536.jpeg 1152w, https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/wp-content\/uploads\/2022\/03\/IMG_0799-1536x2048.jpeg 1536w, https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/wp-content\/uploads\/2022\/03\/IMG_0799-1200x1600.jpeg 1200w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/> <img loading=\"lazy\" class=\"alignnone size-full wp-image-2448\" src=\"https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/wp-content\/uploads\/2022\/03\/IMG_0801-scaled.jpeg\" alt=\"\" width=\"1920\" height=\"2560\" srcset=\"https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/wp-content\/uploads\/2022\/03\/IMG_0801-scaled.jpeg 1920w, https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/wp-content\/uploads\/2022\/03\/IMG_0801-225x300.jpeg 225w, https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/wp-content\/uploads\/2022\/03\/IMG_0801-768x1024.jpeg 768w, https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/wp-content\/uploads\/2022\/03\/IMG_0801-1152x1536.jpeg 1152w, https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/wp-content\/uploads\/2022\/03\/IMG_0801-1536x2048.jpeg 1536w, https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/wp-content\/uploads\/2022\/03\/IMG_0801-1200x1600.jpeg 1200w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/> <img loading=\"lazy\" class=\"alignnone size-full wp-image-2450\" src=\"https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/wp-content\/uploads\/2022\/03\/IMG_0804-scaled.jpeg\" alt=\"\" width=\"1920\" height=\"2560\" srcset=\"https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/wp-content\/uploads\/2022\/03\/IMG_0804-scaled.jpeg 1920w, https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/wp-content\/uploads\/2022\/03\/IMG_0804-225x300.jpeg 225w, https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/wp-content\/uploads\/2022\/03\/IMG_0804-768x1024.jpeg 768w, https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/wp-content\/uploads\/2022\/03\/IMG_0804-1152x1536.jpeg 1152w, https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/wp-content\/uploads\/2022\/03\/IMG_0804-1536x2048.jpeg 1536w, https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/wp-content\/uploads\/2022\/03\/IMG_0804-1200x1600.jpeg 1200w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/> <img loading=\"lazy\" class=\"alignnone size-full wp-image-2451\" src=\"https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/wp-content\/uploads\/2022\/03\/IMG_0805-scaled.jpeg\" alt=\"\" width=\"1920\" height=\"2560\" srcset=\"https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/wp-content\/uploads\/2022\/03\/IMG_0805-scaled.jpeg 1920w, https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/wp-content\/uploads\/2022\/03\/IMG_0805-225x300.jpeg 225w, https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/wp-content\/uploads\/2022\/03\/IMG_0805-768x1024.jpeg 768w, https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/wp-content\/uploads\/2022\/03\/IMG_0805-1152x1536.jpeg 1152w, https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/wp-content\/uploads\/2022\/03\/IMG_0805-1536x2048.jpeg 1536w, https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/wp-content\/uploads\/2022\/03\/IMG_0805-1200x1600.jpeg 1200w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/> <img loading=\"lazy\" class=\"alignnone size-full wp-image-2452\" src=\"https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/wp-content\/uploads\/2022\/03\/IMG_0806-scaled.jpeg\" alt=\"\" width=\"1920\" height=\"2560\" srcset=\"https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/wp-content\/uploads\/2022\/03\/IMG_0806-scaled.jpeg 1920w, https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/wp-content\/uploads\/2022\/03\/IMG_0806-225x300.jpeg 225w, https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/wp-content\/uploads\/2022\/03\/IMG_0806-768x1024.jpeg 768w, https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/wp-content\/uploads\/2022\/03\/IMG_0806-1152x1536.jpeg 1152w, https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/wp-content\/uploads\/2022\/03\/IMG_0806-1536x2048.jpeg 1536w, https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/wp-content\/uploads\/2022\/03\/IMG_0806-1200x1600.jpeg 1200w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/> <img loading=\"lazy\" class=\"alignnone size-full wp-image-2453\" src=\"https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/wp-content\/uploads\/2022\/03\/IMG_0807-scaled.jpeg\" alt=\"\" width=\"1920\" height=\"2560\" srcset=\"https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/wp-content\/uploads\/2022\/03\/IMG_0807-scaled.jpeg 1920w, https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/wp-content\/uploads\/2022\/03\/IMG_0807-225x300.jpeg 225w, https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/wp-content\/uploads\/2022\/03\/IMG_0807-768x1024.jpeg 768w, https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/wp-content\/uploads\/2022\/03\/IMG_0807-1152x1536.jpeg 1152w, https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/wp-content\/uploads\/2022\/03\/IMG_0807-1536x2048.jpeg 1536w, https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/wp-content\/uploads\/2022\/03\/IMG_0807-1200x1600.jpeg 1200w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/p>\n<h2>Videos:<\/h2>\n<p><a href=\"https:\/\/drive.google.com\/file\/d\/1bbMjEQvB_VD9qj1RGrmv_SkLf9rx5DvT\/view?usp=sharing\">Demo of physical build<\/a><\/p>\n<h2>Code:<\/h2>\n<p>&nbsp;<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">\/*\r\n   Crit 2: Location Feedback w\/Sound\r\n   Judson Kyle\r\n   judsonk\r\n\r\n   Description:\r\n*\/\r\n\r\n#include &lt;Audio.h&gt;\r\n#include &lt;Wire.h&gt;\r\n#include &lt;SPI.h&gt;\r\n#include &lt;SD.h&gt;\r\n#include &lt;SerialFlash.h&gt;\r\n\r\nAudioPlaySdWav           playWav1;\r\nAudioMixer4              mixer1;         \/\/xy=647,408\r\nAudioOutputMQS           mqs1;           \/\/xy=625,279\r\nAudioConnection          patchCord1(playWav1, 0, mqs1, 0);\r\nAudioConnection          patchCord2(playWav1, 1, mqs1, 1);\r\n\r\n#define SDCARD_CS_PIN    BUILTIN_SDCARD\r\n#define SDCARD_MOSI_PIN  11  \/\/ not actually used\r\n#define SDCARD_SCK_PIN   13  \/\/ not actually used\r\n\r\n#define TRIGGER0   17\r\n#define TRIGGER1   18\r\n#define TRIGGER2   19\r\n#define TRIGGER3   20\r\n#define TRIGGER4   21\r\n#define TRIGGER5   33\r\n#define TRIGGER6   33\r\n#define TRIGGER7   33\r\n#define TRIGGER8   33\r\n#define TRIGGER9   33\r\n#define TRIGGER10  33\r\n#define TRIGGER11  33\r\n#define TRIGGER12  33\r\n\r\nconst char* outside = \"Outside.WAV\";\r\nconst char* sunRoom = \"Sun Room.WAV\";\r\nconst char* livingRoom = \"Living Room.WAV\";\r\nconst char* bed1 = \"Bedroom 1.WAV\";\r\nconst char* bed2 = \"Bedroom 2.WAV\";\r\nconst char* bed3 = \"Bedroom 3.WAV\";\r\nconst char* kitchen = \"Kitchen.WAV\";\r\nconst char* laundryRoom = \"Laundry Room.WAV\";\r\nconst char* diningRoom = \"Dining Room.WAV\";\r\nconst char* bath1 = \"Bathroom 1.WAV\";\r\nconst char* bath2 = \"Bathroom 2.WAV\";\r\nconst char* hall1 = \"Hallway 1.WAV\";\r\nconst char* hall2 = \"Hallway 2.WAV\";\r\n\r\n\/\/char *roomNames[13] = { outside,    sunRoom,      livingRoom,\r\n\/\/                        bed1,       bed2,         bed3,\r\n\/\/                        kitchen,    laundryRoom,  diningRoom,\r\n\/\/                        bath1,      bath2,        hall1,\r\n\/\/                        hall2};\r\n\r\nint triggerPins[13] = { TRIGGER0,   TRIGGER2,   TRIGGER3,   TRIGGER4,\r\n                        TRIGGER4,   TRIGGER5,   TRIGGER6,   TRIGGER7,\r\n                        TRIGGER8,   TRIGGER9,   TRIGGER10,  TRIGGER11,\r\n                        TRIGGER12\r\n                      };\r\nint numTriggers = 13;\r\nint currTriggerOn = 0;\r\nint prevTriggerOn = -1;\r\nint prevRoom = 0;\r\nvolatile int currRoom = 0;\r\n\r\nunsigned long currTime = 0;\r\nunsigned long debounceTime = 100;\r\nvolatile unsigned long startTime = 0;\r\nvolatile bool DEBOUNCE = false;\r\n\r\nconst char* currFileName = outside;\r\n\r\nvoid setup(void)\r\n{\r\n  \/\/ Wait for at least 3 seconds for the USB serial connection\r\n  Serial.begin (9600);\r\n\r\n  AudioMemory(8);\r\n\r\n  pinMode(TRIGGER0, INPUT);\r\n  pinMode(TRIGGER1, INPUT);\r\n  pinMode(TRIGGER2, INPUT);\r\n  pinMode(TRIGGER3, INPUT);\r\n  pinMode(TRIGGER4, INPUT);\r\n\r\n  SPI.setMOSI(SDCARD_MOSI_PIN);\r\n  SPI.setSCK(SDCARD_SCK_PIN);\r\n  if (!(SD.begin(SDCARD_CS_PIN))) {\r\n    \/\/ stop here, but print a message repetitively\r\n    while (1) {\r\n      Serial.println(\"Unable to access the SD card\");\r\n      delay(500);\r\n    }\r\n  }\r\n\r\n}\r\n\r\nvoid loop (void)\r\n{\r\n  currTime = millis();\r\n\r\n  if (!DEBOUNCE &amp;&amp; !playWav1.isPlaying()) {\r\n    updateCurrRoom();\r\n    DEBOUNCE = true;\r\n    startTime = currTime;\r\n  }\r\n\r\n  if (currTriggerOn != prevTriggerOn) {\r\n    updateCurrRoom();\r\n  }\r\n\r\n  if (prevRoom != currRoom) {\r\n    if (playWav1.isPlaying()) {\r\n      playWav1.togglePlayPause();\r\n    }\r\n    playWav1.play(currFileName);\r\n    Serial.println(currRoom);\r\n  }\r\n\r\n  prevRoom = currRoom;\r\n  prevTriggerOn = currTriggerOn;\r\n\r\n  \/\/Update debounce state\r\n  DEBOUNCE = abs(currTime - startTime) &lt; debounceTime;\r\n}\r\n\r\nvoid updateCurrRoom() {\r\n  switch (currRoom) {\r\n    case 0:\r\n      if (digitalRead(TRIGGER0) &gt; 0) {\r\n        currRoom = 1;\r\n        currFileName = sunRoom;\r\n      }\r\n      break;\r\n    case 1:\r\n      if (digitalRead(TRIGGER0) &gt; 0) {\r\n        currRoom = 0;\r\n        currFileName = outside;\r\n      }\r\n      else if (digitalRead(TRIGGER1) &gt; 0) {\r\n        currRoom = 2;\r\n        currFileName = livingRoom;\r\n      }\r\n      break;\r\n    case 2:\r\n      if (digitalRead(TRIGGER2) &gt; 0) {\r\n        currRoom = 8;\r\n        currFileName = diningRoom;\r\n      }\r\n      else if (digitalRead(TRIGGER1) &gt; 0) {\r\n        currRoom = 1;\r\n        currFileName = sunRoom;\r\n      }\r\n      break;\r\n    case 3:\r\n      if (digitalRead(TRIGGER3) &gt; 0) {\r\n        currRoom = 8;\r\n        currFileName = diningRoom;\r\n      }\r\n      break;\r\n    case 8:\r\n      if (digitalRead(TRIGGER2) &gt; 0) {\r\n        currRoom = 2;\r\n        currFileName = livingRoom;\r\n      }\r\n      else if (digitalRead(TRIGGER4) &gt; 0) {\r\n        currRoom = 9;\r\n        currFileName = bath1;\r\n      }\r\n      else if (digitalRead(TRIGGER3) &gt; 0) {\r\n        currRoom = 3;\r\n        currFileName = bed1;\r\n      }\r\n      break;\r\n    case 9:\r\n      if (digitalRead(TRIGGER4) &gt; 0) {\r\n        currRoom = 8;\r\n        currFileName = diningRoom;\r\n      }\r\n      break;\r\n    default:\r\n      break;\r\n  }\r\n}<\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">let serial;\r\nlet latestData = \"waiting for data\";\r\nvar outData;\r\n\r\nvar minWidth = 600;   \/\/set min width and height for canvas\r\nvar minHeight = 400;\r\nvar width, height;    \/\/ actual width and height for the sketch\r\nvar squareWidth = 100;\r\n\r\nvar greenColor = '#64d65d';\r\nvar redColor = '#d6220c';\r\n\r\nvar currRoom = 0;\r\n\r\nclass Room {\r\n  constructor(length, height, xOffset, yOffset, color, name) {\r\n    this.scale = 40;\r\n    this.length = length*this.scale;\r\n    this.height = height*this.scale;\r\n    this.xOffset = xOffset*this.scale;\r\n    this.yOffset = yOffset*this.scale;\r\n    this.color = color; \r\n    this.name = name;\r\n  }\r\n  getX(canvasWidth) {\r\n    return (canvasWidth - 12*this.scale)\/2 + this.xOffset;\r\n  }\r\n  getY(canvasHeight) {\r\n    return (canvasHeight + 17*this.scale)\/2 - this.yOffset - this.height;\r\n  }\r\n}\r\n\r\nlet sunRoom = new Room(6, 2, 0, 0, redColor, \"Sun Room\");\r\nlet livingRoom = new Room(6, 5, 0, 2, redColor, \"Living Room\");\r\nlet dinningRoom = new Room(6, 4, 0, 7, redColor, \"Dinning Room\");\r\nlet bed1 = new Room(6, 7, 6, 0, redColor, \"Bedroom 1\");\r\nlet bed2 = new Room(6, 5, 6, 11, redColor, \"Bedroom 2\");\r\nlet bed3 = new Room(5, 3, 0, 11, redColor, \"Bedroom 3\");\r\nlet kitchen = new Room(4, 3, 2, 14, redColor, \"Kitchen\");\r\nlet laundryRoom = new Room(2, 1, 0, 16, redColor, \"Laundry Room\");\r\nlet bath1 = new Room(5, 4, 7, 7, redColor, \"Bathroom 1\");\r\nlet bath2 = new Room(2, 2, 0, 14, redColor, \"Bathroom 2\");\r\nlet hall1 = new Room(1, 4, 6, 7, redColor, \"Hall 1\");\r\nlet hall2 = new Room(1, 3, 5, 11, redColor, \"Hall 2\");\r\nlet outside = new Room(0, 0, 0, 0, redColor, \"Outside\");\r\n\r\n\r\nvar rooms = [ outside, sunRoom,  livingRoom, \r\n              bed1,     bed2,        bed3, \r\n              kitchen,  laundryRoom, dinningRoom,\r\n              bath1,    bath2, \r\n              hall1,    hall2];\r\n\r\nvar scale = 10;\r\n\r\n\r\nfunction setup() {\r\n \/\/ set the canvas to match the window size\r\n if (window.innerWidth &gt; minWidth){\r\n  width = window.innerWidth;\r\n  } else {\r\n    width = minWidth;\r\n  }\r\n  if (window.innerHeight &gt; minHeight) {\r\n    height = window.innerHeight;\r\n  } else {\r\n    height = minHeight;\r\n  }\r\n\r\n  originX = width\/2 - 5.5*scale;\r\n  originY = height\/2 - 8.5*scale;\r\n\r\n  \/\/set up canvas\r\n  createCanvas(width, height);\r\n  noStroke();\r\n\r\n serial = new p5.SerialPort();\r\n\r\n serial.list();\r\n serial.open('\/dev\/tty.usbmodem114760901');\r\n\r\n serial.on('connected', serverConnected);\r\n\r\n serial.on('list', gotList);\r\n\r\n serial.on('data', gotData);\r\n\r\n serial.on('error', gotError);\r\n\r\n serial.on('open', gotOpen);\r\n\r\n serial.on('close', gotClose);\r\n}\r\n\r\nfunction serverConnected() {\r\n print(\"Connected to Server\");\r\n}\r\n\r\nfunction gotList(thelist) {\r\n print(\"List of Serial Ports:\");\r\n\r\n for (let i = 0; i &lt; thelist.length; i++) {\r\n  print(i + \" \" + thelist[i]);\r\n }\r\n}\r\n\r\nfunction gotOpen() {\r\n print(\"Serial Port is Open\");\r\n}\r\n\r\nfunction gotClose(){\r\n print(\"Serial Port is Closed\");\r\n latestData = \"Serial Port is Closed\";\r\n}\r\n\r\nfunction gotError(theerror) {\r\n print(theerror);\r\n}\r\n\r\nfunction gotData() {\r\n  let currentString = serial.readLine();\r\n  trim(currentString);\r\n  if (!currentString) return;\r\n  console.log(currentString);\r\n  latestData = Number(currentString);\r\n  currRoom = latestData;\r\n  for (i = 0; i &lt; rooms.length; i++) {\r\n    rooms[i].color = redColor;\r\n  }\r\n  rooms[currRoom].color = greenColor;\r\n}\r\n\r\nfunction draw() {  \r\n  background(0);\r\n\r\n  \/\/Draw canvas\r\n  strokeWeight(4);\r\n  stroke('white');\r\n  fill('black');\r\n  noStroke();\r\n\r\n  fill(255);\r\n  textSize(16);\r\n  text(\"House Map\", 30, 30);\r\n  text(\"Current Room: \" + rooms[currRoom].name, 30, 50);    \/\/ displaying the input\r\n\r\n  \/\/Draw Rooms\r\n  strokeWeight(4);\r\n  stroke('black');\r\n  \/\/ fill(redColor);\r\n  for (i = 0; i &lt; rooms.length; i++) {\r\n    fill(rooms[i].color);\r\n    rect(rooms[i].getX(width), rooms[i].getY(height), rooms[i].length, rooms[i].height);\r\n  }\r\n\r\n}\r\n\r\nfunction mousePressed() {\r\n  var currX = mouseX;\r\n  var currY = mouseY;\r\n\r\n  for (i = 0; i &lt; rooms.length; i++) {\r\n    var roomX = rooms[i].getX(width);\r\n    var roomY = rooms[i].getY(height);\r\n\r\n    var check1 = (currX &gt; roomX) &amp;&amp; (currX &lt; roomX + rooms[i].length);\r\n    var check2 = (currY &gt; roomY) &amp;&amp; (currY &lt; roomY + rooms[i].height);\r\n    \r\n    if (check1 &amp;&amp; check2) {\r\n      currRoom = i;\r\n      rooms[i].color = greenColor;\r\n    }\r\n    else {\r\n      rooms[i].color = redColor;\r\n    }\r\n  }\r\n  \r\n}\r\n\r\nfunction mouseDragged() {\r\n\r\n}<\/pre>\n<h2>Electrical Schematic:<\/h2>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Description: The purpose of this device is to assist people in locating themselves when they enter a new room in their home or other location. The basic idea is that when someone enters a room, a speaker will relay what room they are entering. This is accomplished by tracking the user&#8217;s position within a house &hellip; <a href=\"https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/?p=2442\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Room Indicator for the Blind&#8221;<\/span><\/a><\/p>\n","protected":false},"author":30,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[16,1],"tags":[],"_links":{"self":[{"href":"https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/index.php?rest_route=\/wp\/v2\/posts\/2442"}],"collection":[{"href":"https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/index.php?rest_route=\/wp\/v2\/users\/30"}],"replies":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2442"}],"version-history":[{"count":3,"href":"https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/index.php?rest_route=\/wp\/v2\/posts\/2442\/revisions"}],"predecessor-version":[{"id":2475,"href":"https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/index.php?rest_route=\/wp\/v2\/posts\/2442\/revisions\/2475"}],"wp:attachment":[{"href":"https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2442"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2442"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2442"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}