Changes for new robot

This commit is contained in:
Marvin Martinson 2018-11-02 12:50:15 +02:00
parent 661c0134bc
commit 23b67e490d
4 changed files with 14 additions and 9 deletions

View File

@ -120,7 +120,8 @@ window.addEventListener('load', function() {
init: function() {
var OPERATORS = [
['line left', 'LEFT'],
['line right', 'RIGHT']
['line right', 'RIGHT'],
['line middle', 'MIDDLE']
];
this.setColour('#E6BF00');
var dropdown = new Blockly.FieldDropdown(OPERATORS);

View File

@ -137,6 +137,8 @@ window.addEventListener('load', function() {
foundTrue = (sumorobot.sensors['line_left'] > 2000);
} else if (/RIGHT/.test(code)) {
foundTrue = (sumorobot.sensors['line_right'] > 2000);
} else if (/MIDDLE/.test(code)) {
foundTrue = (sumorobot.sensors['line_middle'] > 2000);
} else {
foundTrue = true;
}

View File

@ -16,6 +16,7 @@ var Sumorobot = function(wsUri, robotId) {
this.sensors = {
'opponent': 99,
'line_left': 0,
'line_middle': 0,
'line_right': 0,
'battery_voltage': 0
};

View File

@ -33,7 +33,7 @@
<div id="battery"><img src="assets/img/battery_disconnected.png"></div>
<div id="panel">
<img class="logo" src="assets/img/logo.png" alt="logo">
<div id="central">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text" id="robot-label">SumoID</span>
@ -44,6 +44,7 @@
<a href="#" class="btn btn-lg btn-robot-go">GO!</a>
</div>
</div>
</div>
<table class="blockly-table">
<tr>