VMA412 Touch Screen with ultrasonic sensor HC-SR04

Hi! I’m trying to use the VMA412 to do a graph of the distance received by the ultrasonic controller. When I upload the Arduino program I can see the graph, but the ultrasonic sensor sends 0.00 cm all the time so the graph only draws a line at 0. My question is if there is any library available to make the Arduino work with the HC-SR04 and the VMA412 at the same time.

Right now I have these libraries:

  • Adafruit_TFTLCD
  • Adafruit_GFX
  • TouchScreen
  • MCUFRIEND_kbv
  • gfxfont

Thank you!

VMA412HCSR04.ino (9.15 KB)

#define LCD_RESET A4 // Can alternately just connect to Arduino's reset pin
#define trigPin SCL

SCL and A4 are the same pin.