Dimming a LCD Display with the Jumper prongs? YwRobot backpack 20x4

Hello, I am trying to add a dimmer knob to my display and was hoping I could just wire it into the jumper lines but I cant seem to find info if thats possible.. Does anyone know how to hook up my dimmer (bottom connections shown in Pic) with my YwRobot backpackextension wires going to the jumbers..

Or do I need code and more items?!

Thanks in advance!

I’m getting somewhere… But thinking I’m not using the pins but using the Arduino…

I used the code for a testing a current sensor i have to see if I got a analog reading from the knob…(below)

void setup() {

  Serial.begin(9600);
}

void loop() {

  int dimmerValue = analogRead(A3);
  Serial.print("Display = ");
  Serial.println(dimmerValue);
  delay(250);
}

With Ground on the left, + 5 V on the right and the center pin going to A3 I get readings… A low of 0 and a high of 1019…

So i’m guessing I need code to make those numbers dim the back light?! I’ll search for how to do the code but if anyone has a way to easily make that work through the LED jumper pins on that backpack it could be very helpful…

Thanks again in advance! :wink:

Here is all my code so far… If anyone cares… It is a weather station on a portable small motorcycle dyno… :wink:

#include "DHT.h"

#include <Wire.h> 

#include <LiquidCrystal_I2C.h>

#define DHTPIN 7

#define DHTTYPE DHT11

DHT dht(DHTPIN, DHTTYPE);

LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);

void setup() {
Serial.begin(9600); 
Serial.println("DHT11");

dht.begin();

  lcd.begin(20,4);    
  
// ------- Quick 3 blinks of backlight  -------------
  for(int i = 0; i< 3; i++)
  {
    lcd.backlight();
    delay(250);
    lcd.noBacklight();
    delay(250);
  }
  lcd.backlight(); // finish with backlight on  

//-------- Write characters on the display ------------------
  // NOTE: Cursor Position: Lines and Characters start at 0  
  lcd.setCursor(3,0); //Start at character 3 on line 0
  lcd.print("Mini Dyno 2000");
  delay(1000);
  lcd.setCursor(5,1);
  lcd.print("Powered by");
  delay(1000);  
  lcd.setCursor(5,2);
  lcd.print("SimpleDyno");
  delay(2500); 
}

void loop() {
  // Reading temperature or humidity takes about 250 milliseconds!
  // Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
  float h = dht.readHumidity();
  float t = dht.readTemperature();
  float f = (t* 9 +2)/5+32;  // The +2 takes care of the better rounding 
delay(1000);
  // check if returns are valid, if they are NaN (not a number) then something went wrong!
  if (isnan(t) || isnan(h)) {
    Serial.println("Failed to read from DHT");
  } else {
    Serial.print("Humidity: ");
    Serial.print(h);
    Serial.print(" %\t");
    Serial.print("Temperature: ");
    Serial.print(f);
    Serial.println(" *F");
   

  lcd.setCursor(3,0);
  lcd.print("Mini Dyno 2000");
  lcd.setCursor(3,1);
  lcd.print("Humidity:"); 
  lcd.print(h);
  lcd.print("%    ");
  lcd.setCursor(3,2);
  lcd.print("Temp: "); 
  lcd.print(f);
  lcd.print(" *F      ");
  lcd.setCursor(0,3);
  lcd.print("Altitude: "); // waiting on sensor
  lcd.print("605 Feet");  // Burbank Altutude
  {
    // when characters arrive over the serial port...
    if (Serial.available()) {
      // wait a bit for the entire message to arrive
      delay(100);
      // clear the screen
      lcd.clear();
      // read all the available characters
      while (Serial.available() > 0) {
        // display each character to the LCD
        lcd.write(Serial.read());
        
        
      }
    }
  }

}
  }

Well I was at work today I read someone used a PPM outlet(?) to the upper pin of the jumper pins and it works.. I tried this with my dimmer/knob just now and it almost works.. All the way left no back light and almost see the text in light at an angle.. Turn the knob to the right and about 20 degrees to the end the back light and text light up a level or two then all the way on for the last 10 degrees or so...

Sooooo, it does look like I need code for the arduino to do it properly...

Off to the programming section...