esphome / esphome-core

🚨 No longer used 🚨 - The C++ framework behind ESPHome
https://esphome.io/
GNU General Public License v3.0
545 stars 113 forks source link

Complie fail for Ultrasonic Sensor #62

Closed nphil closed 6 years ago

nphil commented 6 years ago

Tried compiling a binary for a HC-SR04 with yaml entries exactly as per the instructions, but I get the following error:

Compiling .pioenvs/couchsensorz/lib698/FastLED/FastLED.cpp.o Compiling .pioenvs/couchsensorz/lib698/FastLED/bitswap.cpp.o Compiling .pioenvs/couchsensorz/lib698/FastLED/colorpalettes.cpp.o Compiling .pioenvs/couchsensorz/lib698/FastLED/colorutils.cpp.o Compiling .pioenvs/couchsensorz/lib698/FastLED/hsv2rgb.cpp.o Compiling .pioenvs/couchsensorz/lib698/FastLED/lib8tion.cpp.o Compiling .pioenvs/couchsensorz/lib698/FastLED/noise.cpp.o Compiling .pioenvs/couchsensorz/lib698/FastLED/power_mgt.cpp.o Compiling .pioenvs/couchsensorz/lib698/FastLED/wiring.cpp.o Compiling .pioenvs/couchsensorz/src/main.cpp.o Compiling .pioenvs/couchsensorz/lib4d9/ESP8266WiFi/ESP8266WiFi.cpp.o Compiling .pioenvs/couchsensorz/lib4d9/ESP8266WiFi/ESP8266WiFiAP.cpp.o Compiling .pioenvs/couchsensorz/lib4d9/ESP8266WiFi/ESP8266WiFiGeneric.cpp.o Compiling .pioenvs/couchsensorz/lib4d9/ESP8266WiFi/ESP8266WiFiMulti.cpp.o Compiling .pioenvs/couchsensorz/lib4d9/ESP8266WiFi/ESP8266WiFiSTA.cpp.o src/main.cpp: In function 'void setup()': src/main.cpp:15:93: error: no matching function for call to 'esphomelib::Application::make_ultrasonic_sensor(const char [18], int)' auto application_makeultrasonicsensor = App.make_ultrasonic_sensor("Ultrasonic Sensor", 12); ^ src/main.cpp:15:93: note: candidate is: In file included from src/main.cpp:2:0: .piolibdeps/esphomelib/src/esphomelib/application.h:464:24: note: esphomelib::Application::MakeUltrasonicSensor esphomelib::Application::make_ultrasonic_sensor(const string&, const esphomelib::GPIOOutputPin&, const esphomelib::GPIOInputPin&, uint32_t) MakeUltrasonicSensor make_ultrasonic_sensor(const std::string &friendly_name, ^ .piolibdeps/esphomelib/src/esphomelib/application.h:464:24: note: candidate expects 4 arguments, 2 provided *** [.pioenvs/couchsensorz/src/main.cpp.o] Error 1 ========================== [ERROR] Took 27.45 seconds ==========================

Any idea what could be wrong?

OttoWinter commented 6 years ago

Ah yes there was a small typo, fixed it now and the example now compiles for me. Thank you very much for pointing this out!

See https://esphomelib.com/esphomeyaml/guides/faq.html#how-do-i-use-the-latest-bleeding-edge-version for updating to the dev version to fix the issue

OttoWinter commented 6 years ago

Closing as fixed...