Hi,
I’m trying to connect a Qwiic Joystick to an ESP32C3, however nothing is printing to the Serial monitor. With the sketch below, the LED turns on, but nothing prints:
#include <Wire.h>
#include "SparkFun_Qwiic_Joystick_Arduino_Library.h" //Click here to get the library: http://librarymanager/All#SparkFun_joystick
JOYSTICK joystick; //Create instance of this object
void setup() {
delay(5000);
pinMode(10, OUTPUT);
digitalWrite(10, HIGH);
Serial.begin(9600);
Serial.println("Qwiic Joystick Example");
if(joystick.begin() == false)
{
Serial.println("Joystick does not appear to be connected. Please check wiring. Freezing...");
while(1);
} else {
Serial.println("Connected");
}
}
void loop() {
Serial.println("test");
Serial.print("X: ");
Serial.print(joystick.getHorizontal());
Serial.print(" Y: ");
Serial.print(joystick.getVertical());
Serial.print(" Button: ");
Serial.println(joystick.getButton());
delay(200);
}
This post might be useful too.
Hello All,
I’ve been programming SparkFun ESP32 products for years and I’m having problems getting Serial to work on this product.
I created a basic Serial test with the following code…
void setup() {
Serial.begin(9600);
while(!Serial);
Serial.println(“SETUP Complete”);
}
void loop() {
delay(1000);
Serial.println(“Loop”);
}
I am using the board definition in the Arduino IDE (v2.3.4 on Win11) of “SparkFun ESP32-S3 Thing Plus” and it is located on COM6. I have tried several other board definitions but nothing seems to work.
I can compile and upload this sketch but there is no output on the IDE Serial Monitor.
I have a SparkX ESP32 Thing Plus C and the sketch works just fine.
I have closed the IDE and restarted. I have restarted my computer. I have cycled power on the board.
I checked Win11 Device Manager to see if there any “Hidden” devices assigned to COM6 and there are none. One thing I did notice is that COM6 of the device is "USB Serial Device (COM6) and the
S…
1 Like
Thanks for your response, however I was unable to resolve this despite setting USB CDC On Boot to “Enabled”.
Update:
I’ve encountered something else using the sketch below and I’m not sure why:
Guru Meditation Error: Core 0 panic'ed (Load access fault). Exception was unhandled.
Core 0 register dump:
MEPC : 0x42008f38 RA : 0x4200007c SP : 0x3fca21f0 GP : 0x3fc95200
TP : 0x3fca2270 T0 : 0x4005890e T1 : 0x3ffffe3e T2 : 0x0000902d
S0/FP : 0x3fc9905c S1 : 0x3fc99000 A0 : 0x00000000 A1 : 0x00000000
A2 : 0x0000000a A3 : 0x3fc97ac0 A4 : 0x00000000 A5 : 0x3fc97ac0
A6 : 0xfa000000 A7 : 0x00000014 S2 : 0x4200184c S3 : 0x00000000
S4 : 0x00000000 S5 : 0x00000000 S6 : 0x00000000 S7 : 0x00000000
S8 : 0x00000000 S9 : 0x00000000 S10 : 0x00000000 S11 : 0x00000000
T3 : 0x3fc99000 T4 : 0x00000001 T5 : 0x3fc99000 T6 : 0x00000001
MSTATUS : 0x00001881 MTVEC : 0x40380001 MCAUSE : 0x00000005 MTVAL : 0x00000000
MHARTID : 0x00000000
3fca2510: 0x55555555 0x55555555 0x55555555 0x55555555 0x55555555 0x55555555 0x78555555 0x3fbaad56
3fca2530: 0x0000013c 0xabba1234 0x0000012f 0x0000003b 0x0000003b 0x00000103 0x00000001 0x3fcab5f0
3fca2550: 0x00000000 0x3fca2568 0x5fb65f00 0x00000000 0x6a7cebf5 0x4b93ceb9 0x000c0301 0x00100101
3fca2570: 0x080c0101 0xffffffff 0x3fffffff 0x08200101 0x000003ff 0x00000000 0x00200201 0x02200c01
3fca2590: 0x0b010100 0x20010720 0x00002000 0x200c0100 0x55010102 0x55555555 0x55555555 0x55555555
3fca25b0: 0x55555555 0x55555555 0x55555555 0x55555555 0x55555555 0x55555555 0x55555555 0x55555555
3fca25d0: 0x55555555 0x55555555 0x55555555 0x55555555 0x55555555 0x55555555 0x55555555 0x55555555
That is printing to my serial console despite not even having Serial.begin(9600) in my sketch.
#include <ArduinoBLE.h>
#include <Wire.h>
#include "SparkFun_Qwiic_Joystick_Arduino_Library.h" //Click here to get the library: http://librarymanager/All#SparkFun_joystick
JOYSTICK joystick; //Create instance of this object
int x, y;
int output[2];
void setup() {
BLE.begin();
BLE.scanForUuid("19B10000-E8F2-537E-4F6C-D104768A1214");
pinMode(10, OUTPUT);
while (!joystick.isConnected()) {
digitalWrite(10, HIGH);
delay(1000);
digitalWrite(10, LOW);
delay(1000);
}
}
void loop() {
BLEDevice peripheral = BLE.available();
if (peripheral) {
if (peripheral.localName() != "Alvik") {
return;
}
BLE.stopScan();
BLECharacteristic directionCharacteristic = peripheral.characteristic("19b10001-e8f2-537e-4f6c-d104768a1214");
if (!directionCharacteristic || !directionCharacteristic.canWrite()) {
peripheral.disconnect();
return;
}
while (peripheral.connected()) {
digitalWrite(10, HIGH);
readJoyStick();
output[0] = (x / 4) - 15;
output[1] = (y / 4) - 15;
directionCharacteristic.writeValue(output, 2);
}
digitalWrite(10, LOW);
}
}
void readJoyStick() {
x = joystick.getHorizontal();
y = joystick.getVertical();
}
Which c3 are you using? Our Pro micro version has some special installation notes Software Setup - SparkFun Pro Micro ESP32-C3 Hookup Guide
Thank you. I followed the steps provided and I see “Sparkfun Pro Micro” and “SparkFun Pro Micro - ESP32C3”. With the first, I get an error when uploading:
avrdude done. Thank you.
Failed uploading: uploading error: exit status 1
With the second, it uploads but I’m still not seeing any printing in the serial monitor.
I’m not entirely sure what is going on with yours…do you have access to a windows/linux machine that you can try instead?
I’m getting the same result on Windows 11.
Was it purchased from us? If so head over to Returns (contact vendor if purchased elsewhere) and we’ll get ya squared away
1 Like