Hi
Need help. I have set up both Blockly and PyCharm to code to our CoDrone Pros at our school. To we have found that the Python code seen in Blockly when copied and pasted into PyCharm does not want to recognise Python commands. See the Blckly generated code here...
import CoDrone
drone = CoDrone.CoDrone()
drone.pair(drone.Nearest)
addEvent('whenKeyPress', function (Keyboard.SPACEBAR){
drone.takeoff()
while drone.is_code_running():
if Key.KEY_PRESSED == Keyboard.z:
drone.move(1,0,0,0,50)
if Key.KEY_PRESSED == Keyboard.x:
drone.move(1,0,0,0,-20)
if Key.KEY_PRESSED == Keyboard.UP:
drone.move(1,0,50,0,0)
if Key.KEY_PRESSED == Keyboard.DOWN:
drone.move(1,0,-50,0,0)
if Key.KEY_PRESSED == Keyboard.LEFT:
drone.move(1,0,0,-50,0)
if Key.KEY_PRESSED == Keyboard.RIGHT:
drone.move(1,0,0,50,0)
if Key.KEY_PRESSED == Keyboard.q:
drone.land()
})
Not anything exciting but keyboard controls.
When pasted into a new CoDrone snip in PyCharm it does not work.
Here is the response...