Skip to content

Problem with a smart Fan #815

Answered by G-D-D-971
G-D-D-971 asked this question in Q&A
Mar 22, 2024 · 2 comments · 8 replies
Discussion options

You must be logged in to vote

Hello, for those like me who are looking to control a non-servomotor with PWM but who have not succeeded here is the code I use, it has not been checked and I do not know if it works...

struct DEV_Fan : Service::Fan {       // Dimmable Fan

  LedPin *ledPin;                                   // NEW! Create reference to Fan Pin instantiated below
  SpanCharacteristic *power;                        // reference to the On Characteristic
  SpanCharacteristic *level;                        // NEW! Create a reference to the speed Characteristic instantiated below
  
  DEV_Fan(int pin) : Service::Fan(){       // constructor() method

    power=new Characteristic::Active();     
                
…

Replies: 2 comments 8 replies

Comment options

You must be logged in to vote
3 replies
@G-D-D-971
Comment options

@HomeSpan
Comment options

@G-D-D-971
Comment options

Comment options

You must be logged in to vote
5 replies
@G-D-D-971
Comment options

Answer selected by G-D-D-971
@alexandrumanta13
Comment options

@G-D-D-971
Comment options

@alexandrumanta13
Comment options

@G-D-D-971
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants