Skip to content

mironovdm/avr_tiny_1wire

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

AVR tiny 1-wire library

Simple 1-Wire software implementation for AVR MCU.

Example

Reading temperature from DS18B20:

wire_reset();
wire_writeByte(0xCC);      // Skip ROM command
wire_writeByte(0x44);      // Convert T command
_delay_ms(750);            // Delay for conversion

wire_reset();
wire_writeByte(0xCC);    // Skip ROM command
wire_writeByte(0xBE);    // Read scratchpad command

int16_t temperature = wire_readByte();  // Read temperature LSB
temperature |= (wire_readByte()<<8);    // Read temperature MSB

About

AVR 1-wire library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published