Skip to content

AVR library for controlling DS18B20 temperature sensors

License

Notifications You must be signed in to change notification settings

Anakiev2/avr-ds18b20

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

avr-ds18b20

The MIT License Travis CI

avr-ds18b20 is an AVR library for controlling DS18B20 temperature sensors. It can be easily compiled for every micro-controller supported by avr-gcc.

Usage example

#include <avr/io.h>
#include <util/delay.h>
#include <stdio.h>

#include <ds18b20/ds18b20.h>

int main( )
{
	int temp;

	while ( 1 )
	{
		//Start conversion (without ROM matching)
		ds18b20convert( &PORTB, &DDRB, &PINB, ( 1 << 0 ), NULL );

		//Delay (sensor needs time to perform conversion)
		_delay_ms( 1000 );

		//Read temperature (without ROM matching)
		ds18b20read( &PORTB, &DDRB, &PINB, ( 1 << 0 ), NULL, &temp );

		//Somehow use data stored in `temp` variable
	}

	return 0;
}

For more information visit wiki.

About

AVR library for controlling DS18B20 temperature sensors

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 93.1%
  • Makefile 6.9%