Hi All,
First time playing with i2c on a Teensy4.1, but I have done is a bunch with other controllers. I load the code below, but I see nothing on my oscilloscope on pins 16, 17, 18, & 19. All 4 pins just sit at 3.3V. No clock, no data, nothing.
Any ideas?
Thanks!
First time playing with i2c on a Teensy4.1, but I have done is a bunch with other controllers. I load the code below, but I see nothing on my oscilloscope on pins 16, 17, 18, & 19. All 4 pins just sit at 3.3V. No clock, no data, nothing.
Any ideas?
Thanks!
Code:
#include <Wire.h>
#include <WireIMXRT.h>
#include <WireKinetis.h>
const byte pinOut_LED = 13;
uint8_t Temp_A = 0;
unsigned long t1,t2,t3,t4,t5;
unsigned long cycleTime_ms = 200;
///////////////////////////////////////////////////////////////////////////////////////////////
void setup()
{
pinMode(pinOut_LED,OUTPUT);
digitalWrite(pinOut_LED,HIGH);
Serial.begin(115200);
delay(100);
Wire.begin();
Wire1.begin();
t1 = millis();
t2 = t1;
}
///////////////////////////////////////////////////////////////////////////////////////////////
void loop()
{
t1 = millis();
if(((t1-t2) >= cycleTime_ms) || (t2 > t1))
{
Serial.print(Temp_A);
Serial.print(" ");
Serial.println();
Wire.beginTransmission(0x01);
Wire.write(Temp_A);
Wire.endTransmission();
Wire1.beginTransmission(0x03);
Wire1.write(Temp_A);
Wire1.endTransmission();
Temp_A++;
t2 = t1;
}
}
///////////////////////////////////////////////////////////////////////////////////////////////