SuggestionsArduino

df robot to turn on rgb leds

userHead chris.garrison 2024-01-10 21:35:42 943 Views5 Replies

New here Looking for simple code to turn on rgb leds from a dfrobots v1.1 pir sensor

I have the pir sketch loaded and working.

thanks

2024-01-12 02:25:40

If you want to use pir module turn on the rgb module and have a rainbow effect, 

 

1.Read the rgb module's wiki first: https://wiki.dfrobot.com/Gravity:Digital_RGB_LED_Module_SKU:DFR0605).

 

2.Install "Adafruit NeoPixel Library". 

  Download library: https://github.com/adafruit/Adafruit_NeoPixel

  Install library method: https://docs.arduino.cc/software/ide-v1/tutorials/installing-libraries#.UxU8mdzF9H0

 

3.Download and run the code of rgb module rainbow effect controlled by the pir module :  https://github.com/zzzqww/DFRobot/tree/24642f67f8b6fd026ad9baefba9229ad4d9710a9/pir%E2%80%94rainbow.

 

userHeadPic Afra
2024-01-12 00:06:48

The sample code demonstrates the LED connection to digital pin13. It means the LED on the board will turn on if the pir on. If you plug another LED module on pin13,  the LED will work as well. (as the picture).

 

You also could connect the LED in different pin, just modify the pin number in the second line.

 

 

 

The relay module's wiki here: https://wiki.dfrobot.com/Gravity:%20Digital%2016A%20Relay%20Module%20V2.0%20SKU%20DFR0251

 

Use the same method to connect the relay module, and upload the same code. 

 

userHeadPic Afra
2024-01-11 19:35:02

The pir sensor's tutorial and code here: https://wiki.dfrobot.com/PIR_Motion_Sensor_V1.0_SKU_SEN0171

 

userHeadPic Afra
chris.garrison wrote:

thanks. this is what I used to load the sketch and the pir sensor is working properly. I need to know the code to turn on an led, rgb led, or relay. What is the code for that and where do I insert it? thanks Afra

2024-01-11 20:06:56
1 Replies
2024-01-10 21:38:58

DFRobote PIR sensor v 1.1

userHeadPic chris.garrison