Grove Oxygen Sensor Pro GGC2330-O2

Hello

I recently purchased the Grove Oxygen sensor with the additional hardware suggested in the page below
https://wiki.seeedstudio.com/Grove-Oxygen-Sensor-Pro/.
The problem is that when i try to upload the code provided on the page to seeeduino it gives me the error code below and I have found no information as to what is wrong with it.

C:\.arduinoIDE-unsaved202366-4108-qmci00.1pyx\sketch_jul6a\sketch_jul6a.ino: In function 'void setup()':
C:\.arduinoIDE-unsaved202366-4108-qmci00.1pyx\sketch_jul6a\sketch_jul6a.ino:3:3: error: 'Serial2' was not declared in this scope
   Serial2.begin(9600);
   ^~~~~~~
C:\.arduinoIDE-unsaved202366-4108-qmci00.1pyx\sketch_jul6a\sketch_jul6a.ino:3:3: note: suggested alternative: 'Serial'
   Serial2.begin(9600);
   ^~~~~~~
   Serial
C:\.arduinoIDE-unsaved202366-4108-qmci00.1pyx\sketch_jul6a\sketch_jul6a.ino: In function 'void loop()':
C:\.arduinoIDE-unsaved202366-4108-qmci00.1pyx\sketch_jul6a\sketch_jul6a.ino:6:7: error: 'Serial2' was not declared in this scope
   if (Serial2.available()){
       ^~~~~~~
C:\.arduinoIDE-unsaved202366-4108-qmci00.1pyx\sketch_jul6a\sketch_jul6a.ino:6:7: note: suggested alternative: 'Serial'
   if (Serial2.available()){
       ^~~~~~~
       Serial
C:\.arduinoIDE-unsaved202366-4108-qmci00.1pyx\sketch_jul6a\sketch_jul6a.ino:34:11: error: 'Serial2' was not declared in this scope
     while(Serial2.read()>=0);    //clear buffer
           ^~~~~~~
C:\.arduinoIDE-unsaved202366-4108-qmci00.1pyx\sketch_jul6a\sketch_jul6a.ino:34:11: note: suggested alternative: 'Serial'
     while(Serial2.read()>=0);    //clear buffer
           ^~~~~~~
           Serial

exit status 1

Compilation error: 'Serial2' was not declared in this scope

The other weird thing is i tried using the demo code from another oxygen sensor provided by seeed
https://wiki.seeedstudio.com/Grove-Gas_Sensor-O2/. Weirdly enough the code is uploading and seems to work, although it always reads only one value (20,9%) even if i put it in an environment with 1% oxygen

PS. In both cases tried both voltage outputs from the base shield, it always gives the same results

Hello,
Regarding the code provided in the first Wiki article, it is based on the Seeeduino Cortex-M0+. To use it on an Arduino board, you need to select Seeeduino Zero as the development board.

Regarding the second Wiki article, it is based on Seeeduino V4. If you initially selected Seeeduino V4 as your development board, there should be no problem running the code.
However, please note that Seeeduino V4 does not have a Serial2 interface. If you’re using Seeeduino V4, you can make specific changes to the code in the first Wiki to see if it works

Hello. So I just found out what the initial mistake was. I have a Seeeduino V4.3 not a Cortex one so that’s the first problem.Regarding the second code it is used with a Grove - Oxygen Sensor(ME2-O2-Ф20) on your page but I have the Grove Oxygen Sensor Pro GGC2330-O2 one. The code seems to be working but while it measures, the O2 value never changes even if I change the percentage of O2 in the container I have enclosed the sensor…Is it because the code is made for the first sensor and not the second one?

Yeah, you’re right. The code is not the same, and even if it can be run, the resulting oxygen value will vary greatly.

Thank you so much for the response.