Hi.
I'm trying to make a class that has the ability to reference an object. I'm getting some errors now that I can't fix myself with google, atleast not with my search inquiries.
I'll post my quick'n'dirty code.
main.cpp:
#include "mbed.h"
#include "leds.h"
DigitalOut led1(LED1);
DigitalOut led2(LED2);
DigitalOut led3(LED3);
DigitalOut led4(LED4);
int main() {
//experimental code:
leds LedClass(led1, led2, led3, led4);
}
leds.cpp:
#include "mbed.h"
#include "leds.h"
leds::leds(const DigitalOut& l1, const DigitalOut& l2, const DigitalOut& l3, const DigitalOut& l4){
wait_ms(200);
l1=1;
}
leds.h:
#ifndef MBED_LEDS_H
#define MBED_LEDS_H
#include "mbed.h"
class leds {
public:
leds(const DigitalOut& l1, const DigitalOut& l2, const DigitalOut& l3, const DigitalOut& l4);
};
#endif
I hope I remembered all the relevant code. Anyways. This doesnt work. It gives me the following errors
"No operator "=" matches these operands (E349)" in file "LEDS/leds.cpp"
and
" ^ (E0)" in file "LEDS/leds.cpp"
This is my first try to reference an object into a class. How could I make this work?
Thanks
Hi.
I'm trying to make a class that has the ability to reference an object. I'm getting some errors now that I can't fix myself with google, atleast not with my search inquiries.
I'll post my quick'n'dirty code.
main.cpp:
leds.cpp:
leds.h:
I hope I remembered all the relevant code. Anyways. This doesnt work. It gives me the following errors
"No operator "=" matches these operands (E349)" in file "LEDS/leds.cpp"
and
" ^ (E0)" in file "LEDS/leds.cpp"
This is my first try to reference an object into a class. How could I make this work?
Thanks