Question about Vext in the Code

Hi @jasonXu ,

Could you explain me a little bit what this line of code does pinMode(Vext,OUTPUT) ?

What is Vext? I can get my hear around it and I have seen it in almost every single example.

Thanks for your help.
Kind regards,

Hi, if you search for a pinout diagram, you will find a pin called “ve” or “vext”.
It’s a pin that deliver 3.3V and it’s anable via pinMode(Vext,OUTPUT) and the command Vext HIGH or LOW.

What are the board you use ?
Alex

Hi @AlexFR,

Thanks for your quick reply. I have seen this on the pinout : VEXT : External power supply (3.3V),
control the switch of VEXT through GPIO(LOW-ON,HIGH-OFF)

I am asking that because I don’t need to output 3.3V to power any device but I take out from my code, it doesn’t work. (example BME280) Any ideas why? if the purpose is just to give 3.3V, i don’t get it.

Take care.

I’have a success running AB01 board with a BME breakout.
Wiring: SDA-SCL from the BME to the CubeCell board. GND to GND and VIN from the breakout to Ve or Vext Pin of the CubeCell board.
On the code I use the with the #include <Seeed_BME280.h> library
and for example

// This enables the output to power the sensor
pinMode(Vext, OUTPUT);
digitalWrite(Vext, LOW);
delay(500);

if(!bme280.init()){
if(ENABLE_SERIAL){
Serial.println(“Device error!”);
}
}

// This delay is required to allow the sensor time to init
delay(500);

temperature = bme280.getTemperature() * 100;
humidity = bme280.getHumidity();
pressure = bme280.getPressure();

Wire.end();

// Turn the power to the sensor off again
digitalWrite(Vext, HIGH);

The advantage of the Vext is to power a sensor only on demand with digitalWrite(Vext,LOW)