SimpleIO
Last updated
Was this helpful?
Last updated
Was this helpful?
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.
- when the button is pressed, the input value will be changed. If it is detected, turn on the led.
- change the sleep time with the raw value read from analog pin to change the blink frequency.
- use the timer to set interrupt and every second the led will be toggled.
- set the duty cycle of the PWM output with the float number between 0.0 and 1.0 read from the analog pin.
- 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.
- brighten and dim three LEDs alternatively by increasing and decreasing the duty cycle of the PWM output.
- change the frequency of the PWM output to generate different notes.
- list a combination of the frequencies of different pitches to generate a harmonious melody.