No Scrolling 8x16 MAX7219

I've been searching this forum and the internet for a few days. Maybe there is no answer. Sorry if I missed it. I am reading a MHT22 Humidity/Temperature sensor and it puts a 2 digit humidity number into a variable called h. I don't care about the temperature. It works great on the serial monitor so I am not posting the code. I want to put the variable h on a 8x16 dot matrix that uses a pair of MAX7219 chips. I want the large digits but I do not want it to scroll. Over time it gets too annoying. Thanks for the help whether it is good or bad news.

Share your Arduino code for max7219, without code no one could help you.

OK, but I am not looking for help with this code but just how to print the variable h to a 8x16 display MAX7219 from any code without scrolling.

#include <DHT.h>
#include <DHT_U.h>
#define DHTPIN A0     // Digital pin connected to the DHT sensor
#define DHTTYPE DHT22   // DHT 22  (AM2302), AM2321

DHT dht(DHTPIN, DHTTYPE);

void setup() {
  Serial.begin(9600);

  dht.begin();
}

void loop() {
  // Wait a few seconds between measurements.
  delay(2000);

  float h = dht.readHumidity();
  
  // Read temperature as Fahrenheit (isFahrenheit = true)
  float f = dht.readTemperature(true);

  Serial.print(F("Humidity: "));
  Serial.print(h,0);
  Serial.print(F("%  Temperature: "));
  Serial.print(f,0);
  Serial.println(F("°F"));
}

There's nothing in that code dealing with MAX7219. Start by posting your code that produces the undesirable scrolling behavior.

MD_Parola and MD_MAX72xx libraries will print your text (amongst lots of other things). Links in my signature block below or you can install it from the Library Manager on the IDE.

You understand. I don't need it in my code. That's why it is not in my code. I said so. I want to use it in any code so when I print a variable with 2 digits to a 8x16 dot matrix that it does NOT scroll. I can find hundreds of examples of Scrolling but none on NOT Scrolling. Thanks for the pointers to the libraries. I'll look for some examples using them and maybe documentation using them.

I'm getting close. h is the variable with humidity reading and I can print it without scrolling to a 8x16 dot matrix display with P.print(h,0);

I would like to have it centered on the display but when it prints it is left justified with 5 empty vertical columns on the right. I am using MD_MAX72xx.h and MD_Parola.h.

#include <MD_Parola.h>
#include <MD_MAX72xx.h>
#include <SPI.h>

#define HARDWARE_TYPE MD_MAX72XX::FC16_HW
#define MAX_DEVICES 2
#define CLK_PIN   13
#define DATA_PIN  11
#define CS_PIN    10

// Hardware SPI connection

MD_Parola P = MD_Parola(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);

#include <DHT.h>
#include <DHT_U.h>
#define DHTPIN A0     // Digital pin connected to the DHT sensor
#define DHTTYPE DHT22   // DHT 22  (AM2302), AM2321

DHT dht(DHTPIN, DHTTYPE);

void setup() {

  P.begin();
  dht.begin();
}

void loop() {
  
  // Wait a few seconds between measurements.
  delay(2000);

  float h = dht.readHumidity();
  
   P.print(h,0);


}

From memory, .print() will print the value in the currently set justification. You need to set that before you print using setTextAlignment().

That's it. Thank you so much for pointing me in the right direction.. P.setTextAlignment(PA_CENTER); right above my P.print command. All that's left is to put it in a box.

#include <MD_Parola.h>
#include <MD_MAX72xx.h>
#include <SPI.h>

#define HARDWARE_TYPE MD_MAX72XX::FC16_HW
#define MAX_DEVICES 2
#define CLK_PIN   13
#define DATA_PIN  11
#define CS_PIN    10

// Hardware SPI connection
MD_Parola P = MD_Parola(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);

#include <DHT.h>
#include <DHT_U.h>
#define DHTPIN A0     // Digital pin connected to the DHT sensor
#define DHTTYPE DHT22   // DHT 22  (AM2302), AM2321

DHT dht(DHTPIN, DHTTYPE);

void setup() {

  P.begin();
  dht.begin();
}

void loop() {
  
  // Wait a few seconds between measurements.
  delay(2000);

  float h = dht.readHumidity();

   P.setTextAlignment(PA_CENTER);
   P.print(h,0);


}