1-wire sensor read

As all you know i am novice on this part of programming :slight_smile:
I have successful connect the Max31850 with K-type thermocouple and i get the data without problem but,the data is from Python script and i use the shell for that.
Anyone have success to read this data inside the Xojo without using a shell command?
Or someone can point me the right direction where to start?

AFAIk there is a library for that, http://wiringpi.com/download-and-install/

One of the functions is analogRead (int pin);

That should work for any analog input.

[quote=265838:@Shant Khatcherian]AFAIk there is a library for that, http://wiringpi.com/download-and-install/

One of the functions is analogRead (int pin);

That should work for any analog input.[/quote]
Thank you Shant for your reply.
Because i don’t know too much about all this,the max31850 i use is ADC that mean digital output or i am wrong?
The data wire is on my gpio pin 4 and from the link you provide me is this right?
analogRead (int pin) --> This returns the value read on the supplied analog input pin.

If it’s a one wire sensor it should be an analog input, a digital input in RPi terms is GPIO on or off input.

analogRead (4) should give you the voltage value on that pin, from 0 to 1023. from there you should be able to calculate your sensor’s reading.

Ok i will give a try then and i will post the results soon i hope :slight_smile:
Thank you for point me the direction to start.

a one-wire device is all but analog !!! it’s a fully digital device !
https://www.maximintegrated.com/en/products/digital/one-wire.html

but it has a sort of serial protocol and can be wired with only one wire using parasitic power from the serial signal
one famous device that uses that protocol is the DS1820 temperature sensor

@Jean-Yves Pochez

Okay, so it should probably be read with a GPIO pin?

I found this, might be helpful to OP.

http://www.modmypi.com/blog/ds18b20-one-wire-digital-temperature-sensor-and-the-raspberry-pi

Yes this is the output i get from Python

72 01 4b 46 7f ff 0e 10 57 : crc=57 YES 72 01 4b 46 7f ff 0e 10 57 t=23125

[quote=265855:@Loannis Kolliageorgas]Yes this is the output i get from Python

72 01 4b 46 7f ff 0e 10 57 : crc=57 YES
72 01 4b 46 7f ff 0e 10 57 t=23125[/quote]

Hi Loannis,

The last portion of the output from Python is the temperature, meaning the measured 1-wire temperature reading of 23125 is 23.125 degrees Celsius.

Yes i know @Eugene Dakin i have the data from the shell,thank you for point out.
The only problem is that i have a shell with Timer and infinity loop and get the temperature every 500ms for about max 5 hours…

it should not be hard to make a 1-wire protocol with the GPIO module using the 1-wire datasheet
but I don’t have time to explore that now
(and also only a raspberry 1 so xojo not available on it !)

I will give i try,but i am sure my code will be a messy :smiley: