I have trying to connect an ultrasonic sensor in scilab and I'am utilizing the Arduino toolbox for it. Unfortunately I cannot connect the ultrasonic sensor directly to scilab unlike the temperature sensor that outputs voltage depending on the temperature so that it can be read by the arduino toolbox using ANALOG_READ block. My solution is using two arduino-nos.
A. Arduino 1
This is Where I programmed the ultrasonic sensor and mapped the sensed distance to output a certain PWM value.
B. Arduino 2
This arduino has the Arduino toolbox.ino uploaded so that it would work on scilab. I tried editing the Arduino toolbox.ino but any change to that ino file would not work in scilab it gives an error saying this is not the Arduino toolbox.ino even though it is and I just inserted a function for the ultrasonic sensor.
Bascially I can now output PWM values with respect to distance so that it can be read in scilab using the DIGITAL_READ block.But I dont know how to interpret the waveform. I want to output it as 0%-100% not just a waveform shown in the Scope.