one-wire example code

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I spent a little bit of time over the weekend porting the Atmel AVR318 code to gcc. If anyone wants it, I've put it up at http://0x0000ff.com/avr/1-wire-example-v1.0.tar.bz2

It appears to work just fine, requires a single digital i/o (I didn't port the USART version, I like using USARTS for other things :) ) and is happily scanning, finding, and using the DS18B20 temperature sensor connected to the AVR.

It's pretty self-contained - just 1wire.{c,h} for all the common 1-wire code. The example has main.c and uart.{c,h} as well and displays the temperature every 3 secs over a serial line. In general, though, just #include "1wire.h", add 1wire.c to the Makefile, and you're done.

Enjoy,
Simon

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Would you consider adding that to the Projects section here and I can move this thread to the Academy Forum.

Moderator

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Done. There seems to be a problem with the project-add-file page if you specify a URL though (I tried it with Firefox and Safari). Downloading the file from my website and adding it by browsing local files worked, though.

Simon