Skip to content

Instantly share code, notes, and snippets.

@horsley
Created October 15, 2022 12:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save horsley/60cf57a8506812fa259c3c6fb7184ba9 to your computer and use it in GitHub Desktop.
Save horsley/60cf57a8506812fa259c3c6fb7184ba9 to your computer and use it in GitHub Desktop.
热水器方波信号,mock水流传感器
#define LED_GPIO 26
#define PWM1_Ch 0
#define PWM1_Res 10
#define PWM1_Freq 50
void setup() {
// put your setup code here, to run once:
ledcAttachPin(LED_GPIO, PWM1_Ch);
ledcSetup(PWM1_Ch, PWM1_Freq, PWM1_Res);
}
void loop() {
// put your main code here, to run repeatedly:
ledcWrite(PWM1_Ch, 50);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment