You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Once the SumoInterface is connected to the SumoRobot you can see the battery icon (up right corner) red, orange or green. This shows the battery charge status of your SumoRobot. Red means that the battery is pretty empty and it should be charged as soon as possible. Your SumoRobot can randomly reset at times when it has low battery. When your SumoRobot is not connected or disconnects from the SumoInterface the battery icon will be with a red cross. Then you can try to reset your SumoRobot by pressing the RESET button underneath the SumoRobot next to he micro USB port. The lightning icon works on SumoBoard v0.4.0 and higher and indicates if the micro USB cable is connected to the SumoRobot to charge the battery.
27
27
28
-
To program your SumoRobot move available blocks from the left toolbox (gray) to the right workspace (white) (see on the image below). You can delete code by dragging it to the trash bin or to the the left toolbox (gray). You can also observe the JavaScript code on the right that is created using the blocks. Once **Start** is pressed the JavaScirpt code on the right gets executed and the block highlight (bright) starts to work (see on the image below). The highlight shows how the SumoRobot is executing the code that you have made. The code is executed from top to bottom.
28
+
To program your SumoRobot move available blocks from the left toolbox (gray) to the right workspace (white) (see on the image below). You can delete code by dragging it to the trash bin or to the the left toolbox (gray). You can also observe the MicroPython code on the right that is created using the blocks. Once **Start** is pressed the JavaScirpt code on the right gets executed and the block highlight (bright) starts to work (see on the image below). The highlight shows how the SumoRobot is executing the code that you have made. The code is executed from top to bottom.
The if_do command block is used to make conditions with opponent and/or line. This allows you to execute commands when a certain condition is true. For example when the SumoRobot sees something in front of it or it sees a line under it.
@@ -55,7 +55,7 @@ The sonar with distance logic block is used for defining a distance the SumoRobo
55
55
## Hotkeys
56
56
57
57
Hold the Alt key in combination with different keys to enable different feature in the interface:
58
-
* alt + p = JavaScript mode (see further below)
58
+
* alt + p = MicroPython mode (see further below)
59
59
* alt + t = to open the calibration panel, change the SumoRobot name, calibrate the sensors and motors (see below)
60
60
* alt + arrow keys = to move the SumoRobot around
61
61
* alt + c = show control panel (to change the connected SumoRobot)
@@ -71,35 +71,35 @@ For line calibration place the SumoRobot on the white surface of the SumoField (
Press alt + p for entering the MicroPython mode. Here you can program the SumoRobot with using MicroPython code, a minified version of Python3. So you can import libraries, use variables, classes, definitions like usual to Python. The functions that are specific to the SumoRobot are explained below.
77
77
78
78
**sumorobot.move(LEFT)**
79
79
This will move the SumoRobot to different directions, use LEFT, RIGHT, FORWARD, BACKWARD or SEARCH. SEARCH is a function that helps to find the other SumoRobot during the SumoMatch. It will rotate the SumoRobot for a while and then make it drive a bit forward. Try it out!
80
80
81
-
**sumorobot.wait(1000)**
81
+
**sumorobot.sleep(1000)**
82
82
This will make the SumoRobot move in a direction for a certain time in case used together with multiple moves and waits. Use wait after each move. Then also adjust the delay value which is in milliseconds, a 1000 milliseconds is 1 second.
83
83
84
-
**sumorobot.isSonar()**
84
+
**sumorobot.is_sonar()**
85
85
This will return if the SumoRobot sees something in front of it or not. It is mainly used to detect the other opponent SumoRobot on the SumoField, but it can be used also to see any other objects in front of the SumoRobot. The SumoRobot is set by default to see 40cm. Use this in combination with a if, else clause and move command.
86
86
87
-
**sumorobot.isLine(LEFT)**
87
+
**sumorobot.is_line(LEFT)**
88
88
This will return if the SumoRobot sees a line under the LEFT or RIGHT sensor. Therefore you can use LEFT or RIGHT with this command. Use it together with a if, else cluase and a move command.
89
89
90
-
**sumorobot.setServo(LEFT, 100)**
90
+
**sumorobot.set_servo(LEFT, 100)**
91
91
This will set the speed for a single servo motor. Use LEFT or RIGHT and values between -100 to 100. The negative values are for one direction and the positive values for the opposite direction.
92
92
93
-
**sumorobot.setLed(STATUS, False)**
93
+
**sumorobot.set_led(STATUS, False)**
94
94
This will set the states of STAUTS, LEFT_LINE, RIGHT_LINE and OPPONENT LEDs. Use False or True. Currently the LEFT_LINE, RIGHT_LINE and OPPONENT LED will be overwritten by the feedback code, that shows if the SumoRobot sees a line or opponent.
95
95
96
-
**sumorobot.getSonarDistance()**
96
+
**sumorobot.get_sonar_value()**
97
97
This will return the distance value of the distance sensor, that is in front of the SumoRobot, in centimeters. Use this to see objects even futher away or react to objects that are closer to the SumoRobot. Use it in a if, else clause to compare it with different values. The returned value will be 0 to 200.
98
98
99
-
**sumorobot.getLine(LEFT)**
99
+
**sumorobot.get_line(LEFT)**
100
100
This will return the brightness value from the line sensors, will be a value between 0 to 4096. Use it in a if, else caluse to compare it with different values, it might be possible to detect different colors.
101
101
102
-
**sumorobot.getBatteryVoltage(LEFT)**
102
+
**sumorobot.get_battery_level(LEFT)**
103
103
This will return the battery voltage of the SumoRobot, it will be a value between 3.0 to 4.2. Use it in a if, else caluse to compare it with different values, to detect how empty or full the battery is. This can be used for charging indication or other purposes.
0 commit comments