After Tinkering the C# library (Win10 iot), everything works.
Now I noticed that the IC on the ultrasonic sensor (behind the sensor marked with T) gets really hot!
The whole board is hot and the sensor in front of the IC is also not touchable hot.
In code, when I get the distance get a variation of 684 and 685.
the code (see below) does work, after I let the IC cool down.
Is there any solution to this heat issue? How can we avoid this? Is there any heatsink to cool the IC?
To calculate the distance, I write the command to the i2c bus, followed by 2 reads of the i2c bus:
public int MeasureInCentimeters() {
var buffer = new[] { (byte)Commands.UltraSonic, (byte)_pin, Constants.Unused, Constants.Unused };
_device.WriteToI2C(buffer);
Task.Delay(80).Wait();
try
{
var b1 = _device.ReadByte();
Task.Delay(10).Wait();
var b2 = _device.ReadByte();
var result = b1 * 256 + b2;
return result;
}
catch (Exception)
{
return -1;
}
}
the script is not really dynamic, concerning paths and seems not work 100%, as for example wiringPi is indeed installed (when I enter sudo apt-get install wiringpi it says I allready have the latest version).
Maybe it has to do with the latest version of Raspberrian?
@anton.kirschhock: coming back to the motor wires snapping off, how did it happen. Did it accidentally snap or did it just wear down and came out after prolonged usage.
Guess wear and tear of reassembly (for a guide I had to make for our course). But got that fixed with another motor, which I had. It is the ultrasonic sensor which I am more worried about, as these motors are commonly used in robotic kits
@anton.kirschhock: do you only have 1 ultrasonic sensor or do you have another one that you could try. And can you try out the Raspiab for Robots image that @Shoban has suggested above.