Use Python
Start Using Python


Convert Blocks to Python

Use the Face Panel
display.show(text, wait=False)
display.show_image(image, time)
display.show_image(image, x, y)
codey.display.set_pixel(x, y, status) / codey.display.toggle_pixel(x, y)
display.get_pixel(x, y)
display.clear()
Use the RGB LED on the Codey
led.show(r, g, b, time)
led_off()
led.set_red(value) / led.set_green(value) / led.set_blue(value)
Make a Sound
speaker.play_melody(name)
speaker.play_note(note_number, beats)
speaker.play_tone(frequency, beats)
speaker.rest(beats)
speaker.stop_sounds()
speaker.volume
Use the Sensors of Codey
button_a.is_pressed()/button_b.is_pressed()/button_c.is_pressed()
potentiometer.get_value()
sound_sensor.get_loudness()
light_sensor.get_value()
motion_sensor.is_shaked()
motion_sensor.is_tilted_left()/motion_sensor.is_tilted_right()/
motion_sensor.is_ears_up()/motion_sensor.is_ears_down()
Gyroscope
get_timer()
reset_timer()
Codey's Events and Flow Control
on_button_a_pressed()/on_button_b_pressed()/on_button_c_pressed()
on_shaked()
on_tilted_left()
on_greater_than(volume, 'sound_sensor')
on_less_than(lightness, 'light_sensor')
on_received(message_name)
broadcast(message_name)
stop_all_scripts()/stop_this_script()/stop_other_scripts()
Let the Rocky move
forward(speed, time)
backward(speed, time)
turn_right(speed, time)
turn_left(speed, time)
turn_right_by_degree(angle)
turn_left_by_degree(angle)
drive(left_speed, right_speed)
stop()
Use Rocky's Sensors and Light
color_ir_sensor.set_led_color(color)
color_ir_sensor.is_obstacle_ahead()
color_ir_sensor
Communicate with Infrared Signals
ir_send(message)
ir_receive()
Last updated
