I would like to read temperature from a LM75 using the ATtiny85 running a core by SpenceKonde and utilizing the TinyWireM library.
My Logic Analyzer does not pick up any I2C communication, when I connect it to an Arduino Nano, it works fine. On the Nano, there is no need for TinyWireM so that's a big difference.
Therefore I conclude that the ATtiny85 is not speaking the right I2C slang to the device.
I also use SoftwareSerial and this works fine. It is visible on the Logic Analyzer.
The LM75 library is not made for ATtiny or TinyWireM, I replace the Wire
references in-place by TinyWireM
reference.
Should it be possible to 'just' replace Wire by TineWireM in the library and could I expect some meaningful data this way?
[updated code]
#include <Arduino.h>
#include <TinyWireM.h>
#include <LM75.h>
#include <SoftwareSerial.h>
#define SOFTWARE_SERIAL_TX_PIN 3
#define SOFTWARE_SERIAL_RX_PIN -1
LM75 sensor;
SoftwareSerial mySerial(SOFTWARE_SERIAL_RX_PIN, SOFTWARE_SERIAL_TX_PIN);
void setup() {
TinyWireM.begin();
mySerial.begin(2400);
mySerial.print("Starting..");
}
void loop() {
delay(1000);
mySerial.println("SO");
mySerial.println(sensor.temp());
delay(1000);
}
TinyWireM.begin()
is part of the library and I have the pull-ups, this setup works on an Arduino Nano