Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
Francesco Paggin committed Nov 17, 2015
1 parent 5d93af9 commit 3c12d03
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 80 deletions.
14 changes: 0 additions & 14 deletions down.svg

This file was deleted.

15 changes: 3 additions & 12 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@

#range { font-size:12px; font-family:"Arial"; color:#3a3; margin:10px 0; display:block; }
#range.warning { color:#f00; }
#range-meter { height:20px; background:#000; text-align:center; width:200px; margin:10px auto; overflow:hidden; }
#range-meter-bar { display:inline-block; height:20px; width:0; background:#555; margin:0; }
#range-meter { height:20px; background:#000; text-align:center; width:200px; margin:10px auto; overflow:hidden; border-radius:2px; }
#range-meter-bar { display:inline-block; height:20px; width:0; background:#555; margin:0; border-radius:2px; }
#range-meter.warning { background:#400; }
#range-meter.warning #range-meter-bar { background:#f00; }
</style>
</head>
Expand All @@ -44,49 +45,41 @@ <h1>Node Robot</h1>
<button class="key_right">&rarr;</button>
</div>

<section></section>

<script type="text/javascript">
var prev;

var url = window.location.href.replace('index.html','').replace('8080/','8080');

function _up() {
if (prev == 'up') return;
prev = 'up';
$('.key_up').addClass('key_active');
$('section').html('<img src="up.svg" />');
$.post(url + '/forward');
}

function _left() {
if (prev == 'left') return;
prev = 'left';
$('.key_left').addClass('key_active');
$('section').html('<img src="left.svg" />');
$.post(url + '/left');
}

function _down() {
if (prev == 'down') return;
prev = 'down';
$('.key_down').addClass('key_active');
$('section').html('<img src="down.svg" />');
$.post(url + '/reverse');
}

function _right() {
if (prev == 'right') return;
prev = 'right';
$('.key_right').addClass('key_active');
$('section').html('<img src="right.svg" />');
$.post(url + '/right');
}

function _stop() {
prev = null;
$('.key_active').removeClass('key_active');
$('section').html('');
$.post(url + '/stop');
}

Expand Down Expand Up @@ -142,7 +135,6 @@ <h1>Node Robot</h1>

var client = new nes.Client(url.replace('http','ws'));
client.connect(function (err) {
if (err) console.log(err);
client.onBroadcast = function (update) {
$('#range').html(update.toFixed(2) + " cm");
var width = parseFloat(update) / 500 * $('#range-meter').width();
Expand All @@ -154,7 +146,6 @@ <h1>Node Robot</h1>
}
}
});

</script>
</body>
</html>
14 changes: 0 additions & 14 deletions left.svg

This file was deleted.

8 changes: 0 additions & 8 deletions readme.txt

This file was deleted.

14 changes: 0 additions & 14 deletions right.svg

This file was deleted.

8 changes: 4 additions & 4 deletions start.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/bin/bash
echo "Connecting bluetooth"
echo "Connecting bluetooth ..."
sudo rfcomm release 0
sudo rfcomm connect 0 98:D3:31:40:04:6B &
echo "Network interface:"
echo "Network interface ..."
ifconfig wlan0
sleep 15
echo "Connecting robot"
sleep 10
echo "Connecting robot ..."
sudo node robot.js
14 changes: 0 additions & 14 deletions up.svg

This file was deleted.

0 comments on commit 3c12d03

Please sign in to comment.