Notifications
Clear all

Boolean behaviour at start up

16 Posts
5 Users
1 Likes
2,356 Views
(@billche)
Member
Joined: 2 years ago
Posts: 6
Topic starter  
Posted by: @binaryrhyme

You could consider making a Door class, with an Initialize() method, and then anything else you want to do..., like CheckStatus(),  Lock(), unLock(), and yes, OnDoorChange(). Then you would just call the Initialize() method on startup, bind any events, etc. You're new to coding, so should you embark on this path, I will apologize in advance for throwing you in the deep end, but you'll eventually thank me. 😉 A best practice is to use smaller functions that do what they say, and not overload them with a lot of different behaviour if you can avoid it.

I googled down this tutorial, but there are many others. I'm assuming the class construct will compile fine for the ESP32.

Programming With Classes and Objects on the Arduino - Circuit Basics

Thanks @ginaryrhyme,

Interesting link, will dig deeper on that regard.

Bill


   
Biny reacted
ReplyQuote
Page 2 / 2