forked from marva/sumorobot-web
Changes for new robot
This commit is contained in:
parent
661c0134bc
commit
23b67e490d
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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
|
||||
};
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user