i am using Arduino IDE 2.3.4 and this problem just happened when i opened it. all of my code just lost colours and became all white. although my code still works fine, it made me harder to examine my code. can anyone help me on this?
Hi @anhkhoi041. Please post your full sketch.
I'll provide instructions you can follow to do that:
- Select Tools > Auto Format from the Arduino IDE menus.
ⓘ This is done to make the code easier for us to read. - Select Edit > Copy for Forum (Markdown) from the Arduino IDE menus.
- In a forum reply here, click on the post composer field.
- Press the Ctrl+V keyboard shortcut (Command+V for macOS users).
This will paste the sketch to the post composer. - Move the cursor outside of the code block markup before you add any additional text to your reply.
- Repeat the above process if your sketch has multiple tabs.
- Click the "Reply" button to post your reply.
When your code requires a library that's not included with the Arduino IDE please post a link to where you downloaded that library from, or if you installed it using Library Manager then say so and state the full name of the library.
Hi, thanks for your help last time. This is my full code, it's just simple code to read 2 encoders at once using esp32. btw, i didn't change anything since i posted the last one, but this appear when i compile my code again
Full sketch:
const uint8_t phase_b = 26;
const uint8_t phase_a = 25;
const uint8_t phase_b1 = 33;
const uint8_t phase_a1 = 32;
const uint8_t R_PWM = 16;
const uint8_t L_PWM = 17;
volatile long pulse = 0;
volatile long pulse1 = 0;
int a;
int b;
void setup(){
Serial.begin(115200);
pinMode(R_PWM, OUTPUT);
pinMode(L_PWM, OUTPUT);
pinMode(phase_a, INPUT_PULLUP);
pinMode(phase_b, INPUT_PULLUP);
pinMode(phase_a1, INPUT_PULLUP);
pinMode(phase_b1, INPUT_PULLUP);
attachInterrupt(phase_a, position, CHANGE);
attachInterrupt(phase_a1, position1, CHANGE);
analogWrite(R_PWM, 0);
analogWrite(L_PWM, 0);
}
void loop(){
// analogWrite(R_PWM, 0);
// analogWrite(L_PWM, 50);
// delay(1000);
// analogWrite(R_PWM, 0);
// analogWrite(L_PWM, 0);
// delay(1000);
double motor_angle = pulse*360.0/1024;
double pendulum_angle = pulse1*360.0/1024;
Serial.print("Motor: ");
Serial.print(pulse);
Serial.print(" | Pendulum: ");
Serial.print(pulse1);
Serial.print(" | Motor angle: ");
Serial.print(motor_angle);
Serial.print(" | Pendulum angle: ");
Serial.println(pendulum_angle);
}
void position() {
if (digitalRead(phase_a)==digitalRead(phase_b)) {
pulse--;
}
else {
pulse++;
}
}
void position1() {
if (digitalRead(phase_a1)==digitalRead(phase_b1)) {
pulse1--;
}
else {
pulse1++;
}
}
New problem:
xtensa-esp-elf-g++.exe: fatal error: '-fuse-linker-plugin', but liblto_plugin.dll not found
compilation terminated.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
