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

FB example fetching temperature from all Dallas sensors on the bus. More...

#include "BBB/pruio.bi"
#include "BBB/pruio_pins.bi"
#include "../bas/pruw1.bi"
Include dependency graph for dallas.bas:

Go to the source code of this file.

Variables

VAR io = NEW PruIo()
 Pointer to libpruio instance.
 
VAR w1 = NEW PruW1(io, P9_15, PRUW1_PARPOW + PRUW1_PULLUP)
 Create new libpruw1 instance.
 
VAR res = CAST(UBYTE PTR, @.DRam[4])
 pointer to measurement data More...
 
VAR crc = .calcCrc(9)
 The checksum (0 = OK).
 

Detailed Description

FB example fetching temperature from all Dallas 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.0

Definition in file dallas.bas.

Variable Documentation

◆ res

VAR res = CAST(UBYTE PTR, @.DRam[4])

pointer to measurement data

check presense pulse (0 = OK).

Definition at line 51 of file dallas.bas.