Sample Bot Data - GigaBots/Dashboard_Mindstorm GitHub Wiki

With a fake/imaginary bot already selected (or created and selected), you can copy and paste this code into the text editor and run it in order to add all of the data (with dummy values) that a real bot might have.

/* dashboard sensor data */
channel.getKeyspace(botId).put('touchDash', { 'touchCount' : 1337, 'touchTime' : 217.53 });
channel.getKeyspace(botId).put('batteryDash', { 'batteryLevel' : 0 });
/* dashboard motor data */
channel.getKeyspace(botId).put( 'aDash', { 'speed': 99.1, 'direction': "stopped", 'directionSwapped': false });
channel.getKeyspace(botId).put( 'bDash', { 'speed': 250.0, 'direction': "stopped", 'directionSwapped': true });
channel.getKeyspace(botId).put( 'cDash', { 'speed': 250.0, 'direction': "stopped", 'directionSwapped': true });
channel.getKeyspace(botId).put( 'dDash', { 'speed': 523.4, 'direction': "stopped", 'directionSwapped': false });
channel.getKeyspace(botId).put( '1Dash', { 'a' : false, 'b' : true, 'c' : true, 'd' : false, 'speed': 250.0, 'direction': "stopped" });
channel.getKeyspace(botId).put( '2Dash', { 'a' : false, 'b' : false, 'c' : false, 'd' : false, 'speed': 0, 'direction': "stopped" });
/* bot system data */
channel.getKeyspace(botId).put('robot', { 
	'ev3' : {
		'name' : "Make-Believe Bot",
		'power' : {
			'batteryCurrent' : 0.05650915,
			'motorCurrent' : 0,
			'voltage' : 7.4115276,
			'voltageMilliVolt': 7411
		},
		'sensors' : {
			'S1' : {
				'availableModes' : {
					0 : "Distance",
					'1' : "Seek"
				},
				'sensorType' : "lejos.hardware.sensor.EV3IRSensor"
			},
			'S2' : {
				'availableModes' : {
					0 : "ColorID",
					1 : "Red",
					2 : "RGB",
					3 : "Ambient"
				},
				'sensorType' : "lejos.hardware.sensor.EV3ColorSensor"
			},
			'S3' : {
				'availableModes' : {
					0 : "Touch"
				},
				'sensorType' : "lejos.hardware.sensor.EV3TouchSensor"
			},
			'S4' : {
				'availableModes' : {
					0 : "Distance"
				},
				'sensorType' : "lejos.hardware.sensor.EV3UltrasonicSensor"
			},		
		}
	}
});
/* bot sensor data */
channel.getKeyspace(botId).put('S3', { 
	'mode' : "Touch",
	'port' : "S3",
	'sensorType' : "lejos.hardware.sensor.EV3TouchSensor",
	values : {
		0 : 1
	}
});
channel.getKeyspace(botId).put('S2', { 
	'mode' : "ColorID",
	'port' : "S2",	
	'sensorType' : "lejos.hardware.sensor.EV3ColorSensor",
	values : {
		0 : 4
	}
}); 
channel.getKeyspace(botId).put('S1', { 
	'mode' : "Distance",
	'port' : "S1",	
	'sensorType' : "lejos.hardware.sensor.EV3IRSensor",
	values : {
		0 : 25.00
	}
});                
channel.getKeyspace(botId).put('S4', { 
	'mode' : "Distance",
	'port' : "S4",
	'sensorType' : "lejos.hardware.sensor.EV3UltrasonicSensor",
	values : {
		0 : 223.00
	}
}); 
// channel.getKeyspace(botId).put('S2', { 
// 	'mode' : "RGB",
// 	'port' : "S2",	
// 	'sensorType' : "lejos.hardware.sensor.EV3ColorSensor",
// 	values : {
// 		0 : 253,
// 		1 : 200,
// 		2 : 199
// 	}
// }); 
// channel.getKeyspace(botId).put('S2', { 
// 	'mode' : "Ambient",
// 	'port' : "S2",	
// 	'sensorType' : "lejos.hardware.sensor.EV3ColorSensor",
// 	values : {
// 		0 : 0.55
// 	}
// });
/* bot motor data */
channel.getKeyspace(botId).put('a', {
	'port' : "a",
	'position' : 153,
	'stalled' : false, 
	'moving' : false,
});
channel.getKeyspace(botId).put('b', {
	'port' : "b",
	'position' : -373,
	'stalled' : false, 
	'moving' : false,
});
channel.getKeyspace(botId).put('c', {
	'port' : "c",
	'position' : 424,
	'stalled' : true, 
	'moving' : false,
});
channel.getKeyspace(botId).put('d', {
	'port' : "d",
	'position' : 0,
	'stalled' : false, 
	'moving' : false,
});
⚠️ **GitHub.com Fallback** ⚠️