SimpleIO

After finished last part, you must know how to use input and output pins.

Now you are ready to go. We are going to get things more exciting. 😎

Follow these examples based on what you have learned before.

  • ButtoncontrolLED - when the button is pressed, the input value will be changed. If it is detected, turn on the led.

  • BlinkAnalogIn - change the sleep time with the raw value read from analog pin to change the blink frequency.

  • BlinkTimer - use the timer to set interrupt and every second the led will be toggled.

  • BrightnessAnalogIn - set the duty cycle of the PWM output with the float number between 0.0 and 1.0 read from the analog pin.

  • Debounce - when the button is pressed, check the input signal in a certain period to ensure the exact status of the button and then turn on the onboard led.

  • LEDsBrightnessControl - brighten and dim three LEDs alternatively by increasing and decreasing the duty cycle of the PWM output.

  • PWMSoundOutput - change the frequency of the PWM output to generate different notes.

  • PWMMelody - list a combination of the frequencies of different pitches to generate a harmonious melody.

Last updated

Was this helpful?