Skip to content

Navigation Menu

Sign in
Sign up

I2C not working corretly on ATTiny85 clone #133

Open

Description

I am using the Arduino 1.8.9 IDE on a ATTiny85 clone.

I can compile properly. I can serial print to NotePad using keyboard.h. I can blink LEDs successfully.

What I can not do is successfully implement I2C. I do not know how to troubleshoot the problem.

If I use I2C scanner, the device is detected but I get back address 0x40 for a BME280. Clearly this is wrong. The address is 0x76.

If I try reading the BME280 (at any address), I get decimal 12378. Something is definitely wrong. I am very familiar with the ESP8266 family but I am too new with this device to work toward a solution by myself.

#include <Wire.h>
#include <DigiKeyboard.h>
#include <TinyBME280.h>
// ATtiny85 Pins
int const sda = PB0;
int const scl = PB2;
void setup()
{
 Wire.begin(); 
 BME280setI2Caddress(0x40);
 //BME280setI2Caddress(0x76);
 BME280setup();
 DigiKeyboard.delay(3000);
}
void loop()
{
int32_t tempc; 
 tempc = BME280temperature();
 DigiKeyboard.print("temp: "); DigiKeyboard.println(tempc);
 DigiKeyboard.delay(5000); // wait 5 seconds for next scan
}

Thoughts? Suggestion? How do I troubleshoot this?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      AltStyle によって変換されたページ (->オリジナル) /