I am a beginner.
I am using Arduino Nano ESP32, but the board starts to generate heat and the board is not recognized by the IDE. If you look at the picture, there is a blue LED next to the reset button and green and orange LEDs on both sides of the USB port.
What is this condition and can I return it to normal?
Below is a sketch uploaded to nano.
#include <SPI.h>
#include "RF24.h"
#include <printf.h> //RCA
#define CE_PIN 9
#define CSN_PIN 10
RF24 radio(CE_PIN, CSN_PIN);
#define Trigger 3
uint8_t address[6] = "00001";
int triggerState = 0;
int comState = 2;
int count = 0;
void setup() {
Serial.begin(115200);
// printf_begin(); //RCA
// delay(1000);
if (!radio.begin()) {
Serial.println("NRF24L01 initialization failed!");
while (1);
}
Serial.println("NRF24L01 is working!");
radio.printDetails();
radio.setPALevel(RF24_PA_MAX); // RF24_PA_MAX is default.
radio.openWritingPipe(address); // always uses pipe 0
radio.stopListening(); // put radio in TX mode
pinMode(Trigger, INPUT);
}
void loop() {
if (count++ > 9999999)
{
radio.write(&comState,sizeof(comState));
count = 0;
Serial.print("C-");
}
if(digitalRead(Trigger)==HIGH && triggerState == 0)
{
triggerState = 1;
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
radio.write(&triggerState,sizeof(triggerState));
Serial.println(" ");
Serial.println("Press");
}
else if (digitalRead(Trigger)==LOW && triggerState == 1)
{
triggerState = 0;
digitalWrite(LED_BUILTIN, LOW);
radio.write(&triggerState,sizeof(triggerState));
Serial.println(" ");
Serial.println("Release");
}
}
