Heart Rate in processing.org

54 views
Skip to first unread message

Robby Balona

unread,
Apr 16, 2014, 9:09:57 AM4/16/14
to ti-chronos-...@googlegroups.com
Hi Guys


With my limited knowledge, I have worked out how to send a heartbeat to the watch from processing.org. All this script does is send random numbers to the heartbeat screen .. could be used to show speed or something.

I did it to understand and see if its possible., so excuse the fact that it does not turn off BlueRobin yet. This is with standard firmware and all. Imagine the potential with Raspberry PI, Arduino etc etc

Next version will be in java I think.


Run it and then start Blue Robin on your watch.

Thanks

Robby
____________________________________



import processing.serial.*;

int brSetId[] = {255, 3, 7,88,99,19,0};
int brStart[] = {255, 2,3};

byte brSetIdNumber[] = byte(brSetId);
byte brStartBlue[] = byte(brStart);


Serial chronos;

void setup() {
  System.setProperty("gnu.io.rxtx.SerialPorts", "/dev/ttyACM0");
  chronos = new Serial(this, "/dev/ttyACM0", 115200);

  chronos.write(brStartBlue);
  chronos.write(brSetIdNumber);

}

void draw() {
  
  float heart = random(255);
  int brHeart[] = {255, 5,4,int(heart)};
  byte brHeartRate[] = byte(brHeart);  
  
  if(chronos.available() >= 0) {
   
  }
  chronos.write(brHeartRate);
}
Reply all
Reply to author
Forward
0 new messages