displaying videos on nokia5110 lcd ?

hello guys

i came across a website that show how to display videos on nokia lcd
the site

i manged to do the first part whitch is make processing 2.0 convert the video to a 1 bit data file.

the second part (read the data file from an SD card and display it ) i have a little problem with it :

1- i want to remove the capacitvie keys dont want it ( just play the video ).
2- what file name ossiciated to my video sohuld i change (that part is not clear for me ).
3- the sd card connections seems to have a proplem in the code .

the code :

the code

1- i want to remove the capacitvie keys dont want it ( just play the video ).

My keyboard has a delete key. I’m guessing that yours does, too. Use it. Delete everything related to the capacative keys, which are only used to select which file to play.

2- what file name ossiciated to my video sohuld i change (that part is not clear for me ).

You have a video with some name. That is the name to use in the call to Sd.open() in loop().

3- the sd card connections seems to have a proplem in the code .

Since you didn’t tell us what you think the problems are, we can’t tell you what the solutions are.

PaulS:
My keyboard has a delete key. I'm guessing that yours does, too. Use it. Delete everything related to the capacative keys, which are only used to select which file to play.
You have a video with some name. That is the name to use in the call to Sd.open() in loop().
Since you didn't tell us what you think the problems are, we can't tell you what the solutions are.

first thank you paulS

1-yes i have a delete, but i would deleted it if i know how key cant recognize the capacitive keys part easly its full of while and if statments.

and i tried to delete most of these command but i get an error , can any one help me please with this part.

2- did you see the code ! there is a lot of "filename" "datafilename" ,
i have to change the SD.open only?

3- the problem is that that the chip select pin (4) are also used in the LCD CS !?

The SD card doesn’t NEED to use pin 4 as the chip select pin. When you call the begin() method, you define the pin to use. Use some other pin if 4 is in use.

This part of the code, in setup(), deals with the switches. Delete all of it.

  while(1) {

    if((readCapacitivePin(19) > 3 && debounce) || firstRun) { // Select file button pressed
      debounce = false;
      firstRun = false; // if program just started, run this function once (to select the first file and display something on the screen)
      while(1) { // look for valid files
        fileName = getFileName(root); // get current filename of what is being read
        String newFileName = "";
        for(int i=0; i<fileName.length(); i++) {
          if(fileName[i] != '~') { // replace all '~'s with nothing, due to a bug with _'s in a filename appearing as _~'s.
            newFileName += fileName[i];
          }
        }
        fileName = newFileName;
        byte len = fileName.length(); // get length of filename
        if(fileName[len-3] == 'D' && fileName[len-2] == 'A' && fileName[len-1] == 'T') { // does the file have .dat extension?
          fileName.toLowerCase(); // make it lower case (files are listed upper case, looks ugly)
          break; // found a valid file (.dat extension) and carry on with rest of program
        }
      }
      delay(100); // stop pressing the button more than once within 100ms, basic debouncing i.e. 'accidental press preventation'
    }
    if(!(readCapacitivePin(19) > 3)) { // let go of the Select file button, you can now press it again
      debounce = true;
    }

    if(readCapacitivePin(18) > 3 && debounce2) { // pressed Toggle FPS button
      debounce2 = false;
      showFPS = !showFPS; // toggle FPS
      delay(100); // stop pressing the button more than once within 100ms, basic debouncing i.e. 'accidental press preventation'
    }
    if(!(readCapacitivePin(18) > 3)) { // let go of the Toggle FPS, you can now press it again
      debounce2 = true;
    }

    display.clearDisplay();
    writeString(6, 0, "Config", 2); // title
    display.drawLine(0, 17, 83, 17, BLACK);

    writeString(0, 19, fileName, 1);
    writeString(0, 29, (showFPS)?"Show FPS: YES":"Show FPS: NO", 1);

    display.drawLine(0, 39, 83, 39, BLACK);
    writeStringInverse(0, 40, "SEL   FPS   OK", 1);

    if(readCapacitivePin(19) > 3) {
      display.fillRect(0, 39, 17, 9, WHITE);
    }
    if(readCapacitivePin(18) > 3) {
      display.fillRect(36, 39, 17, 9, WHITE);
    }
    display.display();
    
    // debugging - shows the readings of the capacitive buttons.
    /*Serial.print(readCapacitivePin(19));
    Serial.print(' ');
    Serial.print(readCapacitivePin(18));
    Serial.print(' ');
    Serial.println(readCapacitivePin(17));*/
    
    if(readCapacitivePin(17) > 3) { // pressed the Play button
      display.clearDisplay();
      display.display();
      break; // carry on with program
    }
  }

In loop(), the String instance fileName is stupidly copied into the String instance dataFileName. Then, the string that dataFileName wraps is copied to the string (NULL terminated char array) __dataFileName.

Create a global variable, of type array of char, called dataFileName, and assign it the name of your video. Then, open() dataFileName, not __dataFileName.

thank you paulS

i created a glopal char :

char FiledataName = video ; // my video data file

but it says video is not declared !

ahmed44:
thank you paulS

i created a glopal char :

char FiledataName = video ; // my video data file

but it says video is not declared !

Well, I’m not surprised.

You need something like:

char fileName[] = "video.vid";

where the part in the quotes matches the name of the video as you have saved it on the SD card.

thank you so much paulS , it compiles right, ( i will test it )