Connect Your Magicbit with Magicblocks. (if you don’t know how to do it, go through this tutorial)
You will need the following nodes.
Double click on the switch node.
Change the value rules as follows and compare elements as numbers.
Find the value of LDR where the light should be turned on. (Here it is used as 1000)
Make the following arrangement.
Double click on the Analog In node.
- Select the pin as LDR
- Select the method as Interrupt
Double click on the Digital out node
Select the correct device ID.
Then select any LED that you want to control.
Double click on the first template node.
Change as follows.
Double click on the second template node.
Change as follows.
Deploy the program.
Cover the LDR to see if the LED turns on.
Comments
Please log in or sign up to comment.