Avr Ds18b20 Save

AVR library for controlling DS18B20 temperature sensors

Project README

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.

Open Source Agenda is not affiliated with "Avr Ds18b20" Project. README Source: Jacajack/avr-ds18b20
Stars
55
Open Issues
0
Last Commit
3 years ago
License
MIT

Open Source Agenda Badge

Open Source Agenda Rating