-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Closed
Description
Hardware:
Board: Dev Module
IDE name: Arduino IDE
Flash Frequency: 80Mhz
PSRAM enabled: no
Upload Speed: 921600
Computer OS: Windows 10
I have a problem with when I use i2c and SPI together.
The i2c comunication only works when I use no SPI.
#include "SPI.h"
#include <Wire.h>
#define SPI_MOSI 23
#define SPI_MISO 19
#define SPI_SCK 18
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Wire.begin();
Wire.beginTransmission(0x60);
Serial.println(String(Wire.endTransmission()) + " Error");
delay(200);
SPI.begin(SPI_SCK, SPI_MISO, SPI_MOSI);
}
void loop() {
// put your main code here, to run repeatedly:
Wire.beginTransmission(0x60);
Serial.println(String(Wire.endTransmission()) + " Error");
delay(1000);
}
The first i2c transmition works fine.
But after enabeling SPI and the i2c is broken and Serial.println(String(Wire.endTransmission()) + " Error");
returns 5.
Metadata
Metadata
Assignees
Labels
No labels