Question about Nodebot Pressure Sensor

Hi,

I am currently working a project which requires me to interface the Arduino board with Nodebot and Johnny-Five (GitHub - rwaldron/johnny-five: JavaScript Robotics and IoT programming framework, developed at Bocoup.). I got the first tutorial to work (with the LED light) but I don't know how to proceed in regards to interfacing the pressure sensor. The pressure sensor I am using is the MPX4115A. The code I used in the Arduino IDE (also has temp sensor code) is:

int pressureValue;
float pressure;
float temperatureC;
float altitude;
float currentaltitude;

float num1;
float num2;
float num3;
float num4;
float num5;

void setup (){
  Serial.begin (9600);
}

void loop (){
  int sensorValue=analogRead(A0);
  float voltage=sensorValue *(5.0/1023.0);
  temperatureC=(voltage-0.5) * 100;
  Serial.print(voltage);
  delay(500);
  pressureValue=analogRead(A1);
  pressure=((pressureValue/1024.0) +0.095)/0.0009;

  num1 = pressure*100.0;
  num2 = num1/101325.0;
  num3 = log10 (num2);
  num4 = (num3/5.25588);
  num5 = pow(10.0, num4) - 1.0;
  altitude = num5/-0.0000225577;
  currentaltitude = 112.02;
  altitude = altitude+currentaltitude;
  
  Serial.print(",");
  
  Serial.print(pressure);
  Serial.print(",");
  Serial.println(altitude);
  delay(500);
}

My question is how would you go about writing the code for the pressure sensor in Javascript and where would it be displayed? I am new to JS and require some assistance in regards to it.

Thanks,

how would you go about writing the code for the pressure sensor in Javascript

Why Javascript? Arduino is programmed in C++. Are you asking how to write a Javascript program for the PC side to read the serial output from the Arduino and display on the PC?

groundfungus:
Why Javascript? Arduino is programmed in C++. Are you asking how to write a Javascript program for the PC side to read the serial output from the Arduino and display on the PC?

Yes, I am trying to write a Javascript program for the PC side to read the serial output from the Arduino and display on the PC using Nodebot (http://nodebots.io/) and Johnny-Five.

Since this is an Arduino forum that deals with the Arduino IDE and C++, you can't expect answers to your questions dealing with Java, Nodebots and Johnny-Five. You may get answers, but don't be too disappointed if you don't.

but don't be too disappointed if you don't.

Or if they are wrong. 8)

I will try some different forums then.

Thanks,