PPG Device with Dancing Led Cube

Hi We are a group of students. Currently my team is working a medical device with visual entertainment on it. We are having issues trying to link the medical device side of to the visual entertainment side of it.

What we want to achieve:

  • When the heartbeat gets faster, the led cube lights up faster.
  • When the heartbeat is beating at normal rate, the led cube dances at the original pace.
  • When the heartbeat get slower, the led cube lights up slower.

but we are unable to.

Currently we are using 1x Arduino Uno for the medical device side of it and 1x Arduino Buno for the Led Cube they will be physically linked at port A1 on Arduino Uno to A1 on Arduino Buno

How can we link them up in terms of codes and make them do what we want ?

These are our current codes are the Attachment files.

4x4 LED Cube.ino (14.9 KB)

PPG With Bluetooth.ino (4.69 KB)

These are our current codes are the Attachment files.

Before I open them, I need to know what they each ACTUALLY do, and how that differs from what you want.

I lied. I opened the PPG one anyway. You appear to be diddling with pins 10 and 11 in the code AND using them for the bluetooth connection. NOT a good idea.

On the other hand, you never actually read from or write to the SoftwareSerial instance (Genotronex), so, never mind.

   mapped = map(data[0], 0, 1023, 0, 600);
   Serial.println(mapped);//send over the current value to the processing sketch, but scale it to match the screen height

What does Processing have to do with your situation?

Your LED cube code appears to use every pin for controlling the cube, so how do you expect to get external data into that Arduino?