Totally 3 8x8 panels will be used. 1 panel for task1 and the remaining panels for task2.
Task1: If I vary the ultrasonic range from 0 to 400cm, LED matrix will start to light up from row 0 to row 7

Task2: Using Potentiometer
Value range from 512 to 0 - panel 1 will glow like row 0 to row 7
Value range from 512 to 1024 - panel 2, row 0 to row 7

Hope I explained in detail.