Hi freaks...
I've built a turbine using a stepper where the shaft is stationary and the body of the motor is attached to the blades.
The idea is that it will be displaying the humidity and temp using an 8 bit POV on one of the blades...
So far everything is working except for the SHT21...
I'm unfamiliar with TWI/I2C and testing it is a bit inconvenient ...
..unplug the battery used for programming, unplug programmer, plug in stepper, turn on fan, wait for spin up without loosing any fingers, etc...
I should have added at least a serial connection but was unaware at the time that the sht21 differed from the sht11...
So hopefully someone can take a look at this code I've attempted to port from an Arduino library using Peter Fleury's I2C lib...
uint16_t readSensor(uint8_t command) { uint16_t result; i2c_start(0x40); //begin i2c_write(command); //send the pointer location _delay_ms(100); i2c_stop(); //end //Store the result result = i2c_read (1); //(1) <<8 ); result = result <<8; result += i2c_read (0); result &= ~0x0003; // clear two low bits (status bits) return result; }
So far it's not returning anything but 0...
I've posted the project on my site, there is the sch, pics and vid...
http://krazatchu.ca/?page_id=198
Thanks,
Michael