libpruw1  0.4
One wire (W1) driver for Beaglebone hardware based on libpruio
onlyDS18S20.c File Reference

C example fetching temperature from all DS18S20 sensors on the bus. More...

#include <stdio.h>
#include <unistd.h>
#include "libpruio/pruio.h"
#include "libpruio/pruio_pins.h"
#include "../c_include/pruw1.h"
Include dependency graph for onlyDS18S20.c:

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 The main function. More...
 

Detailed Description

C example fetching temperature from all DS18S20 sensors on the bus.

This example demonstrates how to

  • initialize the libpruw1 library,
  • define a GPIO header pin as one wire bus,
  • handle error codes on initialization,
  • scan the bus for all dallas sensor devices,
  • perform 11 temperature convert broardcasts,
  • read the measurement results from the sensor scratchpads, and
  • print them on the screen.

Check the output for enabled monitoring feature as well, see section Monitoring Feature for details.

Since
0.2

Definition in file onlyDS18S20.c.

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

The main function.

create new driver structure

< pointer to measurement result

< The checksum (0 = OK).

Definition at line 28 of file onlyDS18S20.c.

Here is the call graph for this function: