<!--
-
-
- Copyright (C) 2019 Xilinx, Inc.  All rights reserved.
-
- Permission is hereby granted, free of charge, to any person obtaining a copy of
- this software and associated documentation files (the "Software"), to deal in
- the Software without restriction, including without limitation the rights to
- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
- of the Software, and to permit persons to whom the Software is furnished to do
- so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in all
- copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS  BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- SOFTWARE.
-
-
- Author: Michael Chyziak <chyziak@xilinx.com>
-
-->

{% extends "Default/default.html" %}
{% block content %}

<div class="page-header">
  <h1 class="display-4"><b>{% block title %}Drive a Button and LED{% endblock %}</b></h1>
</div>

<h2>Description</h2>
<div class="well">
  <p>This example shows how to read a button and control an LED. Make sure to insert the long part of the LED into the socket with the "+" and the smaller part into the socket with the "-". If the LED doesn't turn on attempt to screw the potentiometer to one direction. For more information on the Grove Sensor Kit please visit <a href="grove_starter_kit.html">Grover Starter Kit</a>.</p>
</div>

<h2>Hardware Setup</h2>
<div class="well">
  <ul class="features" style="list-style-position:inside">  
    <li>Attach the Grove Button to connector A0</li>
    <li>Attach the the Grove LED to connector D3</li>
  </ul>
  <img class="img-responsive center-block" src="{{url_for('static', filename='images/96boards_images/Example_Button_LED.png')}}" onclick="showImageModal(this)"/>
  <br>
  <form action="led_button.html" method="post" onsubmit="return submitFormAsync(this)">
    <center><button type="submit" class="btn btn-primary btn-lg">Run Project</button></center>
  </form>
</div>

<h2>Source Code</h2>
<div class="well">
  <form action="viewer.html" method="get">
    <button type="submit" name="filename" value="button_led/button_led.ino" class="btn btn-primary">button_led.ino</button>
  </form>
</div>

{% endblock %}
