but what types of devices will be limited by what the original code can support.
Arduino can certainly use OOP and you can do "new" as pointed out already. But bear in mind you only have 2K SRAM on arduino so don't get too comfy with OOP stuff. I would rather instantiate a fixed number of different objects and reuse them. If you get too excited and instantiate too many objects, you may run out of memory. Just my 2 cents.
I did something similar for a system where users could arbitrarily add model trains to a layout.Different manufacturers' trains used different control code, so I implemented a virtual control function in a base class, and had code specific to each system in derived classes. The system would then dynamically create and object of the desired class when it detected the addition of a new train.
Please enter a valid email to subscribe
We need to confirm your email address.
To complete the subscription, please click the link in the
email we just sent you.
Thank you for subscribing!
via Egeo 16