The values your joystick is sending, are not the highest values the motors can understand. You can adjust these to make the robot faster.
It uses the same part of the code as in the 'help your robot drive in a straight line' example.
Before speeding up your robot, you must find out what values are being sent by your joystick.
During testing, you do not want your robot to drive around - put it on the stand, or hold it so that it cannot drive off.
To view the values, you need to use the REPL again.
Flash your code to the joystick's micro:bit, click the REPL button on Mu, then press the reset button on your micro:bit.
Look carefully values in the REPL:
Write down the highest number you can get from the joystick.
If you have already adjusted your code to help your robot drive in a straight line, skip to Step 3.
Open your joystick code, and find the def joystick_push(): section, which is above your while True: loop.
You are going to add some new code into this function, do not delete anything that is already there, and don't repeat any lines of code!
Currently, this function works out what numbers to send to the robot, to be the speed of the left and right wheels.
Add two new lines into the function, so that it looks like this:
def joystick_push():
x = int(pin0.read_analog() - 512)
y = int(pin1.read_analog() - 512)
left = (y + x)
right = (y - x)
left = int( left * 1 )
right = int( right * 1 )
return left, right
The two new lines won't do anything yet - but you can change these to make your robot go faster.
Test your code and make sure that it still works before moving on.
The highest value that the motors can understand, is 1023.
You can make the value from the joystick larger, by multiplying it - the trick is to make sure it doesn't go any higher than 1023, or you will get an error message.
Try changing the number from 1 to 1.1 - test the code and see how the numbers change in the REPL - can you get it close to, but not higher than 1023?
If you have already adjusted your code to help your robot drive in a straight line, one of your numbers will start lower than 1. Remember to keep this one lower, so that your robot still drives in a straight line.