The Arduino digital pin numbers on the schematic you provided do not match the Arduino digital pin
numbers you filled into the constructor.
You appeared to use the physical pin number for the nano module instead.
Take a close look at your shematic. See the Dn numbers?
Those are the Arduino digital pin numbers and are totally different
from the physical pin number of the board/module.
Actually, it looks to me like the Nano module pin numbers were used in the
constructor rather than the Arduino digital pin numbers.
The module pin numbers are the ones in parens.
The Arduino pin numbers are ones with Dn or An.
The Arduino pin numbers are what are used in the constructor.