Download Print this page

ODROID -GO Manual

Arduino blue led and pwm

Advertisement

Quick Links

2023/05/05 21:45
Arduino for ODROID-GO - Blue LED and PWM
Make sure that you've followed these guides.
Refer to the Arduino official documents. This tells us useful common functions
with great instructions.
Refer to the ESP32 official programming guide. Most of ESP32 specific functions
introduced here.
We don't need odroid_go.h library for this step.
You can implement the breathing effect as well by using fading functions in the
ledc.h. Not to be dealt with in this guide.
We will learn that how to control the blue status LED on the board and how to adjust PWM value to
give a breathing effect to the LED with Arduino.
Blink the blue LED
ODROID Wiki - https://wiki.odroid.com/
1/5
Getting started with Arduino
Arduino for ODROID-GO - Hello World
https://www.arduino.cc/reference/en/
https://esp-idf.readthedocs.io/en/v3.0/
Arduino for ODROID-GO - Blue LED and PWM

Advertisement

loading

Summary of Contents for ODROID ODROID-GO

  • Page 1 2023/05/05 21:45 Arduino for ODROID-GO - Blue LED and PWM Arduino for ODROID-GO - Blue LED and PWM Make sure that you've followed these guides. Getting started with Arduino Arduino for ODROID-GO - Hello World Refer to the Arduino official documents. This tells us useful common functions with great instructions.
  • Page 2 Last update: 2018/06/11 odroid_go:arduino:03_blue_led_and_pwm https://wiki.odroid.com/odroid_go/arduino/03_blue_led_and_pwm?rev=1528687521 12:25 Let's make the LED blinks permanently. Open a new sketch by pressing the shortcut CTRL-N. You're able to control that LED very easily. The pin number for the LED is 2. Define that with Preprocessor.
  • Page 3 2023/05/05 21:45 Arduino for ODROID-GO - Blue LED and PWM Give the LED to breathing effect With adjusting analog output value, as known as PWM, we can make the LED breathing. Arduino gives us wrappers that helps control of GPIO pins, as well as to control of PWM features.
  • Page 4 Last update: 2018/06/11 odroid_go:arduino:03_blue_led_and_pwm https://wiki.odroid.com/odroid_go/arduino/03_blue_led_and_pwm?rev=1528687521 12:25 void loop() { // put your main code here, to run repeatedly: And control the pin mode of the LED to output. It might be not a necessary step, but to make sure. #define PIN_BLUE_LED...
  • Page 5 2023/05/05 21:45 Arduino for ODROID-GO - Blue LED and PWM ledcAttachPin(PIN_BLUE_LED, PWM_CHANNEL); ledcSetup(PWM_CHANNEL, 12000, 8); void loop() { // put your main code here, to run repeatedly: pinVal >= 0; pinVal--) { ledcWrite(PIN_CHANNEL, pinVal); delay(3); pinVal < 256; pinVal++) { ledcWrite(PIN_CHANNEL, pinVal);...