How to connect graphic LCD 128x64 ST7565

Hey guys,

I am working on a project to control an aircraft flap. Everything works fine.
With a cam switch I can control the flap in three positions.

There is just only one thing left. I want to display the positions on a LCD display (LCD 128x64 ST7565).
I only don’t have any knowledge about LCD displays.

Could someone explain me how to wire the display to an Arduino UNO R3 and how to adjust my code.

Code

#include <Servo.h>

Servo myservo;  // servo declareren

void setup()
{
  Serial.begin(9600); // seriele communicatie aanzetten voor eventueel debug mogelijkheden
  myservo.attach(9);  // aangeven dat de servo op pin 9 zit
}

void loop() 
{  
  int waarde = 0;                // waarde is standaard 0
  if(digitalRead(2)==1){         // check input 2
    waarde=1;
  }
  else if(digitalRead(3)==1){    // check input 3
    waarde=2;
  }
  else if(digitalRead(4)==1){    // check input 4
    waarde=3;
  }
  
  //Serial.print("De waarde is: ");
  //Serial.println(waarde);
  //delay(1000);
 
  waarde = map(waarde, 0, 3, 0, 60);     // schaal de waarde naar waardes tussen de 0 en 60 graden
  myservo.write(waarde);                 // stuur deze waarde door naar de servo
  delay(100);                            // geef de servo de tijd om daar deze waarde te draaien
}

I hope someone could help me out.

Thanks

FlapCircuitDEFV2.pdf (46.6 KB)

There are a lot of ST7565 out there. Do you have the datasheet available.

Lines CS_N (chipselect or "cs"), RST_N (reset), A0 (or command data/data command or "dc"), SCLK (clock) and SID (data line) could be connected to any digital output pin of the Arduino. SCLK and SID are the SPI signals, so for max speed, connect SID to pin SPI data line (pin 11 on the Uno) and SCLK to the SPI clock line (pin 13 for Uno). Then use a proper library to control your display (e.g. u8g2).

The other four pins are a little bit strange. They probably require two 2.2uF caps, but it is not clear how to connect them. For this, you need to consult the datasheet.

Oliver