Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
9 years, 3 months ago.
Compiler Error 349 raised by your class example
Under Step 2, making is a class, the first section of main.cpp (copied below):
main.cpp
class Flasher { public: Flasher(PinName pin) : _pin(pin) { // _pin(pin) means pass pin to the DigitalOut constructor _pin = 0; // default the output to 0 }
The 6th line raises a compiler error - "Error: No operator "=" matches these operands in "main.cpp" "
Can't see why this would be? I may well have made an error copying it over, but I can't see anything.
Hi George, I can only re-create your error if I Use _pin = "O"; i.e different data types make sure it is _pin = 0; a numeral Regards
posted by Martin Simpson 05 Aug 2015Hi Martin, I have published the code for reference, https://developer.mbed.org/users/melmon/code/MUX_class_test/ it does have a numerical 0
posted by George Edwards 05 Aug 2015so you are trying to write a 0 to an Input? i.e. the analogue input..... just comment out the _pin = 0; regards
posted by Martin Simpson 05 Aug 2015