Message Boards Message Boards

Problem using Arduino with Mathematica

I`m trying to read a weigh value from a scale with the code above and using the this library https://github.com/bogde/HX711

Code:

arduino = DeviceOpen["Arduino", "COM3"]
DeviceConfigure[arduino, 
  "Upload" -> {"Libraries" -> 
     "C:\\Users\\adm\\Documents\\Arduino\\libraries\\HX711-master", 
    Initialization -> "HX711 scale(A1,A0);
     void setupScale()
     {
        Serial.begin(38400);
        scale.set_scale(146.f);
        scale.tare();
     }",
    "Functions" -> <|
      "Scale" -> 
       ArduinoCode[<|"ArgumentTypes" -> {}, "ReturnType" -> Real, 
         "Code" -> "
          float medicao()
          { 
          return scale.get_units(10);
          }
          "|>]|>}];

I know that Arduino code works because I tested in Arduino IDE before and works, but when I use in Mathematica an it just shows me the output below -[Infinity].

enter image description here

I wanna know what is causing this and how I fix it.

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract