Skip to main content
replaced http://mathematica.stackexchange.com/ with https://mathematica.stackexchange.com/
Source Link

Difficult question to answer, because it's impossible to verify any proposed solution. I can merely guess what the problem is:

  1. I don't think that BaudRate should be specified in the Arduino code. I'd write: DeviceOpen["Arduino", {"COM3", "BaudRate" -> 38400}]

  2. Your setupScale()-function is in fact never executed. It's prepended to the Arduino sketch but never executed. You need to call it too! The standard way of doing this would be to add byte initScale = 0; in the initialization code, and then in the Scale-function add:

    if (!initScale) { initScale = 1; setupScale(); }

That way, the setup function will be run the first time you call the function.

Try these things and see if it works.

(For some example code, look here: Direct Pressure Data Acquisition with Mathematica and ArduinoDirect Pressure Data Acquisition with Mathematica and Arduino)

Difficult question to answer, because it's impossible to verify any proposed solution. I can merely guess what the problem is:

  1. I don't think that BaudRate should be specified in the Arduino code. I'd write: DeviceOpen["Arduino", {"COM3", "BaudRate" -> 38400}]

  2. Your setupScale()-function is in fact never executed. It's prepended to the Arduino sketch but never executed. You need to call it too! The standard way of doing this would be to add byte initScale = 0; in the initialization code, and then in the Scale-function add:

    if (!initScale) { initScale = 1; setupScale(); }

That way, the setup function will be run the first time you call the function.

Try these things and see if it works.

(For some example code, look here: Direct Pressure Data Acquisition with Mathematica and Arduino)

Difficult question to answer, because it's impossible to verify any proposed solution. I can merely guess what the problem is:

  1. I don't think that BaudRate should be specified in the Arduino code. I'd write: DeviceOpen["Arduino", {"COM3", "BaudRate" -> 38400}]

  2. Your setupScale()-function is in fact never executed. It's prepended to the Arduino sketch but never executed. You need to call it too! The standard way of doing this would be to add byte initScale = 0; in the initialization code, and then in the Scale-function add:

    if (!initScale) { initScale = 1; setupScale(); }

That way, the setup function will be run the first time you call the function.

Try these things and see if it works.

(For some example code, look here: Direct Pressure Data Acquisition with Mathematica and Arduino)

added 169 characters in body
Source Link
V.E.
  • 1.7k
  • 18
  • 17

Difficult question to answer, because it's impossible to verify any proposed solution. I can merely guess what the problem is:

  1. I don't think that BaudRate should be specified in the Arduino code. I'd write: DeviceOpen["Arduino", {"COM3", "BaudRate" -> 38400}]

  2. Your setupScale()-function is in fact never executed. It's prepended to the Arduino sketch but never executed. You need to call it too! The standard way of doing this would be to add byte initScale = 0; in the initialization code, and then in the Scale-function add:

    if (!initScale) { initScale = 1; setupScale(); }

That way, the setup function will be run the first time you call the function.

Try these things and see if it works.

(For some example code, look here: Direct Pressure Data Acquisition with Mathematica and Arduino)

Difficult question to answer, because it's impossible to verify any proposed solution. I can merely guess what the problem is:

  1. I don't think that BaudRate should be specified in the Arduino code. I'd write: DeviceOpen["Arduino", {"COM3", "BaudRate" -> 38400}]

  2. Your setupScale()-function is in fact never executed. It's prepended to the Arduino sketch but never executed. You need to call it too! The standard way of doing this would be to add byte initScale = 0; in the initialization code, and then in the Scale-function add:

    if (!initScale) { initScale = 1; setupScale(); }

That way, the setup function will be run the first time you call the function.

Try these things and see if it works.

Difficult question to answer, because it's impossible to verify any proposed solution. I can merely guess what the problem is:

  1. I don't think that BaudRate should be specified in the Arduino code. I'd write: DeviceOpen["Arduino", {"COM3", "BaudRate" -> 38400}]

  2. Your setupScale()-function is in fact never executed. It's prepended to the Arduino sketch but never executed. You need to call it too! The standard way of doing this would be to add byte initScale = 0; in the initialization code, and then in the Scale-function add:

    if (!initScale) { initScale = 1; setupScale(); }

That way, the setup function will be run the first time you call the function.

Try these things and see if it works.

(For some example code, look here: Direct Pressure Data Acquisition with Mathematica and Arduino)

Source Link
V.E.
  • 1.7k
  • 18
  • 17

Difficult question to answer, because it's impossible to verify any proposed solution. I can merely guess what the problem is:

  1. I don't think that BaudRate should be specified in the Arduino code. I'd write: DeviceOpen["Arduino", {"COM3", "BaudRate" -> 38400}]

  2. Your setupScale()-function is in fact never executed. It's prepended to the Arduino sketch but never executed. You need to call it too! The standard way of doing this would be to add byte initScale = 0; in the initialization code, and then in the Scale-function add:

    if (!initScale) { initScale = 1; setupScale(); }

That way, the setup function will be run the first time you call the function.

Try these things and see if it works.