Difference between revisions of "Switch and LED with Explore M3"
(One intermediate revision by one other user not shown) | |||
Line 19: | Line 19: | ||
Below is the sample code to read the switch status and turn ON/OFF the LED. | Below is the sample code to read the switch status and turn ON/OFF the LED. | ||
<html> | <html> | ||
− | <script src="https://gist.github.com/SaheblalBagwan/ | + | <script src="https://gist.github.com/SaheblalBagwan/e72cbee37ab01b9a48e2ae4176b9f4eb.js"></script> |
</html> | </html> | ||
<br><br> | <br><br> | ||
− | + | [[File:Lpc1768 Switch LED.gif]] | |
=Demo= | =Demo= |
Latest revision as of 12:33, 5 May 2016
In this tutorial we will see how read a switch and trun ON/OFF the LED/Buzzer/Relay using the explore Embedded bare metal libraries. The libraries can be used on different platforms like Keil, ARM GCC, GCC And Eclipse etc.
Contents
Prerequisites
Please check this tutorial for detailed explanation on lpc1768 Gpio configuration.
If you are doing it for the first time, then check the below links to setup the project for generating the .bin file.
Hardware Connection
ExploreM3 comes with an USB_BOOT switch and on board led connected to pin 13.
Code
Below is the sample code to read the switch status and turn ON/OFF the LED.