Help me please

Dependencies:   mbed HCSR04

Committer:
koko1121
Date:
Wed Jan 15 17:17:21 2020 +0000
Revision:
0:b78e02ab7cde
Error: Too many arguments in function call in "main.cpp", Line: 27, Col: 28;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
koko1121 0:b78e02ab7cde 1 #include "mbed.h"
koko1121 0:b78e02ab7cde 2 #include "hcsr04.h"
koko1121 0:b78e02ab7cde 3 #include <LiquidCrystal_I2C.h>
koko1121 0:b78e02ab7cde 4
koko1121 0:b78e02ab7cde 5 // Set the LCD address to 0x27 for a 16 chars and 2 line display
koko1121 0:b78e02ab7cde 6 LiquidCrystal_I2C lcd(0x4E, 16, 2);
koko1121 0:b78e02ab7cde 7
koko1121 0:b78e02ab7cde 8
koko1121 0:b78e02ab7cde 9
koko1121 0:b78e02ab7cde 10 //D9 TRIGGER D8 ECHO
koko1121 0:b78e02ab7cde 11 HCSR04 sensor(D8, D9);
koko1121 0:b78e02ab7cde 12
koko1121 0:b78e02ab7cde 13
koko1121 0:b78e02ab7cde 14 int main() {
koko1121 0:b78e02ab7cde 15 lcd.begin();
koko1121 0:b78e02ab7cde 16 lcd.backlight();
koko1121 0:b78e02ab7cde 17 lcd.print(" Ultrasonic");
koko1121 0:b78e02ab7cde 18
koko1121 0:b78e02ab7cde 19 //lcd.print("Distance = ",distance); //show on lcd 16x2
koko1121 0:b78e02ab7cde 20
koko1121 0:b78e02ab7cde 21
koko1121 0:b78e02ab7cde 22 while(1) {
koko1121 0:b78e02ab7cde 23 int x = sensor.distance();
koko1121 0:b78e02ab7cde 24 printf("distance %d \n\r",x); //Test in Tera
koko1121 0:b78e02ab7cde 25 wait(1.0); // 1 sec
koko1121 0:b78e02ab7cde 26 lcd.setCursor(0,1);
koko1121 0:b78e02ab7cde 27 lcd.print(" Ultrasonic",&x);
koko1121 0:b78e02ab7cde 28
koko1121 0:b78e02ab7cde 29 }
koko1121 0:b78e02ab7cde 30 }