<commit_before><!DOCTYPE html>
<html>
<head>

<meta charset=utf-8 />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<style type="text/css">
body {
	margin: 15px;
	font-family: sans-serif;
	font-size: 16px;
	line-height: 1.5em;
	color: #666;
}
h2 {
	padding-left: 0px;
	font-weight: normal;
	font-size: 28px;
	color: #00AEFF;
}
.ledBtns {
	padding: 10px;
	font-size: 22px;
	width: 130px;
	color: #00AEFF;
	margin-bottom: 20px;
}
.container {
	background-color: #f7f7f7;
	padding-left: 10px;
	border: 1px dotted #CCC;
	width: 280px;
	margin-top: 20px;
}
.spacer {
	margin-left: 5px;
}

</style>

<title>Blink LED</title>

<script src="../../dist/Breakout.js"></script>
<script src="../libs/jquery-1.7.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {

	// Declare these variables so you don't have
	// to type the full namespace
	var IOBoard = BO.IOBoard;
	var IOBoardEvent = BO.IOBoardEvent;
	var LED = BO.io.LED;
	
	// Set to true to print debug messages to console
	BO.enableDebugging = false;	

	// If you are not serving this file from the same computer
	// that the Arduino board is connected to, replace
	// location.hostname with the IP address or hostname
	// of the computer that the Arduino board is connected to.
	var arduino = new IOBoard(location.hostname, 8887);
	
	// Variables
	var led;
	var delay = 1000;
	
	// Listen for the IOBoard READY event which indicates the IOBoard
	// is ready to send and receive data
	arduino.addEventListener(IOBoardEvent.READY, onReady);

	function onReady(event) {
		// Remove the event listener because it is no longer needed
		arduino.removeEventListener(IOBoardEvent.READY, onReady);

		// Create an LED object to interface with the LED wired
		// to the I/O board
		led = new LED(arduino, arduino.getDigitalPin(11));
		
		// Use jQuery to get a reference to the buttons
		// and listen for click events
		$('#btnStart').on('click', turnLedOn);		
		$('#btnStop').on('click', turnLedOff);
	}

	function turnLedOn(evt) {
		led.on();
		setTimeout(blinking, delay);
	}

	function turnLedOff(evt) {
		// Turn the LED off
		led.off();
	}
	
	function blinking() {
		led.off();
		setTimeout(turnLedOn, delay);
	}
});

</script>

</head>
<body>
	<h2>Blink LED Example</h2>
		<div class="container">
			<p>Use the buttons below to start the blinking process and stop it.</p>
			<button id="btnStart" class="ledBtns" type="button">Start</button>
			<span class="spacer"></span>
			<button id="btnStop" class="ledBtns" type="button">Stop</button>
		</div>
</body>
</html><commit_msg>Details about the advance example added<commit_after><!DOCTYPE html>
<html>
<head>

<meta charset=utf-8 />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<style type="text/css">
body {
	margin: 15px;
	font-family: sans-serif;
	font-size: 16px;
	line-height: 1.5em;
	color: #666;
}
h2 {
	padding-left: 0px;
	font-weight: normal;
	font-size: 28px;
	color: #00AEFF;
}
.ledBtns {
	padding: 10px;
	font-size: 22px;
	width: 130px;
	color: #00AEFF;
	margin-bottom: 20px;
}
.container {
	background-color: #f7f7f7;
	padding-left: 10px;
	border: 1px dotted #CCC;
	width: 280px;
	margin-top: 20px;
}
.spacer {
	margin-left: 5px;
}

</style>

<title>Blink LED Example</title>

<script src="../../dist/Breakout.js"></script>
<script src="../libs/jquery-1.7.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
	// Declare these variables so you don't have
	// to type the full namespace
	var IOBoard = BO.IOBoard;
	var IOBoardEvent = BO.IOBoardEvent;
	var LED = BO.io.LED;
	
	// Set to true to print debug messages to console
	BO.enableDebugging = false;	

	// If you are not serving this file from the same computer
	// that the Arduino board is connected to, replace
	// location.hostname with the IP address or hostname
	// of the computer that the Arduino board is connected to.
	var arduino = new IOBoard(location.hostname, 8887);
	
	// Variables
	var led;
	var delay = 1000;
	
	// Listen for the IOBoard READY event which indicates the IOBoard
	// is ready to send and receive data
	arduino.addEventListener(IOBoardEvent.READY, onReady);

	function onReady(event) {
		// Remove the event listener because it is no longer needed
		arduino.removeEventListener(IOBoardEvent.READY, onReady);

		// Create an LED object to interface with the LED wired
		// to the I/O board
		led = new LED(arduino, arduino.getDigitalPin(11));
		
		// Use jQuery to get a reference to the buttons
		// and listen for click events
		$('#btnStart').on('click', turnLedOn);		
		$('#btnStop').on('click', turnLedOff);
	}

	function turnLedOn(evt) {
		led.on();
		setTimeout(blinking, delay);
	}

	function turnLedOff(evt) {
		// Turn the LED off
		led.off();
	}
	
	function blinking() {
		led.off();
		setTimeout(turnLedOn, delay);
	}
});

</script>

</head>
<body>
	<h2>Blink LED</h2>
		<div class="container">
			<p>Use the buttons below to start the blinking process and stop it.</p>
			<button id="btnStart" class="ledBtns" type="button">Start</button>
			<span class="spacer"></span>
			<button id="btnStop" class="ledBtns" type="button">Stop</button>
			<small>For a more elegant solution, please check out the <a href="../generators/blink_led.html">Blink with Generator</a> example.</small>
		</div>
</body>
</html>
{'fraction_non_alphanumeric': 0.1446188340807175, 'fraction_numerical': 0.02092675635276532, 'mean_word_length': 3.8399638336347195, 'pattern_counts': {'":': 0, '<': 69, '<?xml version=': 0, '>': 69, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6873977', 'n_tokens_mistral': 2061, 'n_tokens_neox': 1889, 'n_words': 554}