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