PPG Device with Dancing Led Cube

We are student from a highschool. Currently my team is working a school project with 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 link together via port A1.

How can we link them up 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)

Delta_G:
What does that mean?

They are physically linked at port A1 on Arduino Uno to A1 on Arduino Buno

Delta_G:
What's stopping you?

We are not sure how to program the codes so that we can do this:

  • 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.

Delta_G:
Yeah, I figured you connected those two pins, but how in the world are they going to communicate that way? Are you planning to use SoftwareSerial on that pin or something? Just connecting them together won't let them talk to one another. I'd advise you to do a little research on communicating between Arduino boards. There's plenty of information available out there to get you started.

Sorry. Im a rookie at programming. Do you mind if you could guide me ? If im just sending out the data from medical side to the entertainment side, do i need to fill in the rxPin ?

#include <SoftwareSerial.h>

const byte rxPin = ??;
const byte txPin = A1;

// set up a new serial object
SoftwareSerial mySerial (0,A1);

What about about the entertainment side? If im just receiving the data from medical side, do i need to fill in the txPin ?

#include <SoftwareSerial.h>

const byte rxPin = 1;
const byte txPin = ??;

// set up a new serial object
SoftwareSerial mySerial (1, 0);

Delta_G:
Otherwise you're going to have to try to break that down into a slightly more specific question.

Do you know what parts of your LED code control the timing? If you can't figure that part out then you're not anywhere close to being able to do this. You need more study. If you can, then it should be simple to change those variables to whatever you want in order to change the speed.

Im not sure about it. But Im willing to learn but Im unsure where i can the information ?

int layer[4]={A3,A2,A1,A0}; //initializing and declaring led layers
int column[16]={13,12,11,10,9,8,7,6,5,4,3,2,1,0,A5,A4}; //initializing and declaring led rows
int time = 250; <- Is this line to control speed ?

Hi I tried to modify the codes for medical side of it but im not sure but it's still not working. Can you help me with it ?

PPG01.ino (6.2 KB)

Hi this is my entertainment side of codes too.

Dancing_Led.ino (3.42 KB)