Home \ Help \ Search \ Login RSS

Welcome, Guest. Please Login

This forum is now READ-ONLY! Please visit http://forum.wiring.co/ for the new forum.

Wiring ForumBugsWebsite,  Reference,  Examples Bugs › SHT15 example

Page Index Toggle Pages: 1
SHT15 example (Read 3532 times)
09/29/10 at 16:42:39

ajkeller   Offline
YaBB Newbies

Posts: 1
*
 
The SHT15 example using the SparkFun breakout does not work with Wiring 0027, but does work with Wiring 0026. I suspect this has something to do with modifications to ShiftOut, although I cannot say for sure (just going by the version log).
 
IP Logged
 
Reply #1 - 09/29/10 at 18:50:50

barragan   Offline
YaBB Administrator

Posts: 939
*****
 
Thanks for the report. Could you please paste the function code below into your sketch (on 0027) and try again? Please let me know.


void shiftOut(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder, uint16_t value) {
  for (uint8_t i = 0; i < 8; ++i) {
    if (bitOrder == LSBFIRST)
      digitalWrite(dataPin, value & (1 << i));
    else
      digitalWrite(dataPin, value & (1 << ((7) - i)));
    digitalWrite(clockPin, HIGH);
    digitalWrite(clockPin, LOW);
  }
}
« Last Edit: 09/29/10 at 21:59:17 by barragan »  
IP Logged
 
Page Index Toggle Pages: 1