ARD SHD LCD3,5 Display without PWM Pins

Hello,
I want to use the ARD SHD LCD3,5 Display on my Arduino MEGA 2560. But I need 3 PWM Pins to regulate 3 MOSFETs for 3 Pumps.
But without these PWM Pins the Display is not working.
So my questions are:

  1. Is there a way to regulate the pumps/MOSFETS without PWM Pins?
    Or
  2. Is there a way to to avoid the PWM Pins for the display and use others?
    Or
  3. Are there other Displays I can use without PWM Pins?
    Thank you very much!

Display: 3.5inch Arduino Display-UNO - LCD wiki

I am not familiar with the display but what is it that makes you think that it needs to be controlled using PWM pins ?

The display could be controlled by digital pins, but the form factor of the screen means that when plugged in to the Mega (or Uno) the PWM pins are used

It would be possible, albeit awkward, to connect the screen to pins of your choice using jumpers and not plug it into the Mega. Modifications would be needed to the sketch and/or library to take into account that different pins were being used

I now have opened the cpp and there a the pins defined

// LCD controller chip identifiers
#define ID_932X 0
#define ID_7575 1
#define ID_9341 2
#define ID_HX8357D 3
#define ID_UNKNOWN 0xFF

These Pins (2,3) are PWM Pins. Could I change it to analog Pins or communication Pins (14,15,...,21) and would it still work? (I think digital Pins wont work).

Or I could change Pin 5 (a PWM Pin) to a normal digital Pin like 22. Because this is the Code:

#ifdef USE_ADAFRUIT_SHIELD_PINOUT
  digitalWrite(5, LOW);
  delay(2);
  digitalWrite(5, HIGH);
#else
  if (_reset) {
    digitalWrite(_reset, LOW);
    delay(2);
    digitalWrite(_reset, HIGH);
  }
#endif

I suspect, but don't know, that the only reason that the PWM pins are used is that it makes it convenient to use them on a shield designed to plug into a Uno

Why not wire the display to the Mega using jumper leads to its normal pins and get it working like that. Then you can experiment with different pin assignments to see what works when you use different pins

Yes but dont I have to change something in some code if I use other Pins than the "usual"?

The pins used by the screen will be defined either in the sketch or the library and, yes, if you use different pins then the definition will need to be changed.

It would be more convenient to do that in the sketch even if they are initially defined in the library because that would avoid changing the library

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.