Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
171 lines (144 sloc) 6.49 KB
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Button Demo</title>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="keywords" content="">
<link rel='shortcut icon' href='images/favicon.ico' type='image/x-icon'>
<link rel="stylesheet" type="text/css" href="css/style.css" >
<link rel="stylesheet" type="text/css" href="css/bootstrap.css" >
<script src="js/jquery-1.8.3.min.js"></script>
<script src="js/com.TI.tokenPoller.js"></script>
<script src="js/page-actions.js"></script>
<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script>
$(function() {
var sprinklerSwitch = $('#sprinklerSwitch'),
switchBtn = $('#switchImage'),
sprinkler = $('#sprinkler'),
spriklerRunning = false,
imageOn = false,
sprinklerToggle = setInterval(function() {
if (spriklerRunning) {
if (imageOn) {
sprinkler.attr('src',"images/lightON.jpg");
imageOn = false;
} else {
sprinkler.attr('src',"images/blacksquare.jpg");
imageOn = true;
}
}
}, 300);
sprinklerSwitch.click(function(){
if (switchBtn.hasClass('on')) {
switchBtn.removeClass('on');
com.TI.toggleLED('_OFF'); // turn off the LED
spriklerRunning = false;
//sprinkler.attr('src',"images/demo-sprinkler-off.jpg");
sprinkler.attr('src',"images/blacksquare.jpg");
imageOn = false;
} else {
switchBtn.addClass('on');
com.TI.toggleLED('_Blink'); // Turn On LED: else if(memcmp(ptr, "Blink", 5) == 0){GPIO_IF_LedOn(MCU_RED_LED_GPIO);}
spriklerRunning = true;
imageOn = true;
}
});
});
</script>
</head>
<body>
<nav class="navbar navbar-inverse" data-spy="affix" data-offset-top="197">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#"><b>CNK TECH LABs</b></a>
</div>
<div class="collapse navbar-collapse" id="myNavbar">
<ul class="nav navbar-nav">
<li class="active"><a href="#">DEMOS</a></li>
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">Welcome<span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="index.html">CC3200 Web</a></li>
<li><a href="overview.html">Overview</a></li>
</ul>
</li>
<li><a href="about.html">About</a></li>
<li><a href="setup.html">Setup</a></li>
<li><a href="portal.html">Developer's Portal</a></li>
<li><a href="demos.html">Demos</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><a href="#"><span class="glyphicon glyphicon-user"></span> Sign Up</a></li>
<li><a href="#"><span class="glyphicon glyphicon-log-in"></span> Login</a></li>
</ul>
</div>
</div>
</nav>
<div class="header">
<div class="ti-logo"></div>
<div class="page-title">
</div>
<div class="red-bar">SimpleLink&trade; Wi-Fi&reg; Family</div>
<div class="status-bar"> Current Status: <em>Offline</em></div>
<!-- toggle class "online" to change status - use js to change status message (later) -->
</div>
<div class="tabs">
<ul>
<li class="" id="welcome"><a href="index.html"><span>Welcome</span></a></li>
<li class="" id="overview"><a href="overview.html"><span>Overview</span></a></li>
<li class="" id="about"><a href="about.html"><span>About</span></a></li>
<li class="" id="setup"><a href="setup.html"><span>Setup</span></a></li>
<li class="" id="portal"><a href="portal.html"><span>Developer's Portal</span></a></li>
<li class="" id="demos"><a href="demos.html"><span>Demos</span></a></li>
</ul>
</div>
<div class="content">
<div class="demoLink automation active" onclick="window.open('demos-sprinkler.html', '_self');"></div>
<div class="demoLink appliances" onclick="window.open('demos-appliances.html', '_self');"></div>
<div class="demoLink safety" onclick="window.open('demos-security.html', '_self');"></div>
<div class="demoLink smartEnergy" onclick="window.open('demos-energy.html', '_self');"></div>
<br style="clear:both" />
<h2>Home Automation</h2>
<p>Click the pushbutton ON to see the red LED on the LaunchPad blink.</p>
<!--
<div class="switchControl" id="sprinklerSwitch">
<div class="sprinklerOn"></div>
<div id="switchImage"></div>
<div class="sprinklerOff"></div>
</div>
-->
<br></br><br></br><br></br>
<div class="DMMrecord" id="sprinklerSwitch">
<div class="sprinklerOn">On</div>
<div id="switchImage" style = "border:2px solid green; width:100%; max-width:400px;"></div>
<div class="sprinklerOff">Off</div>
</div>
<br></br><br></br>
<div class="DMMrecord">
<img border=1 name=img10 src="images/lightON.jpg" id = "sprinkler" align="center" hspace="0" style="border:4px solid green; width:100%; max-width:300px;">
</div>
<br></br>
<br></br>
<br></br>
<!--
<img src="images/demo-sprinkler-off.jpg" id="sprinkler" style="max-width:325px; width:80%;height:342px\0/IE8+9;" />
-->
<p>It's raining outside and you forgot to turn off the sprinkler. No problem. This demo shows you how SimpleLink CC3200 can be used to control the sprinkler system via the cloud.<br /><br />Simply click on the On/Off buttons you see on your screen, you will see the sprinkler turn on and off. You can also see the LED lights flashing on and off.</p>
<div class="didYouKnow">
<span>Did you know?</span>
<p>CC3200 has low-power consumption due to its innovative one-chip architecture. The Wi-Fi sensors can run on 2xAA batteries for over 1 year! </p>
</div>
<div class="footer"><a href="http://www.ti.com/privacy">Privacy Policy</a> | <a href="http://www.ti.com/termsofuse">Terms of Use</a></div>
</div>
</body>
</html>