Markus_L811
Well-known member
Now with DS18B20 One-Wire-Slave Sample inside [attachInterrupt not working: solved]
Hello,
I tried following sketch on the Teensy 3
To look at the Onewire timing but I get nothing on the T3, the Onewire Master runs on an second T3 and drives a net with 2 DS18B20 and worked with them well.
Grounds (GND) connected btw. The Master is connected with my PC and has the DS18x20 running from Paul, the other T3 with the sketch above runs with seperate power over the USB connector.
Hello,
I tried following sketch on the Teensy 3
Code:
int pin = 13;
volatile int state = LOW;
volatile unsigned long previousMillis = 0;
volatile unsigned long old_previousMillis = 0;
volatile unsigned long difference = 0;
void setup() {
Serial.begin(9600);
pinMode(pin, OUTPUT);
attachInterrupt(12, blink, CHANGE);
}
void loop() {
digitalWrite(pin, state);
if (difference >= 100 && difference <= 1500)
Serial.println(difference);
}
void blink() {
old_previousMillis = previousMillis;
previousMillis = micros();
difference = previousMillis - old_previousMillis;
state = !state;
}
To look at the Onewire timing but I get nothing on the T3, the Onewire Master runs on an second T3 and drives a net with 2 DS18B20 and worked with them well.
Grounds (GND) connected btw. The Master is connected with my PC and has the DS18x20 running from Paul, the other T3 with the sketch above runs with seperate power over the USB connector.
Last edited: