Robomaster S1 Comes to Life 4.0 Python Program Example. Unleash the True Power of the Robomaster S1 #2
Unanswered
ROBOMASTER-S1
asked this question in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
'''Robomaster S1 Comes to Life 4.0'''
Created by Joseph C. Richardson, GitHub.com
Make Robomaster S1 come to life. Simply copy or download this program example.
You must copy and paste the program code into your Robomaster app. After that,
simply click the blue play button, then clap your hands three times to wake him
up. To make him sleep, simply tap any one of his bottom hit detectors.
This Robomaster S1 program example uses four powerful random generator
functions. The random.randint(), the random.choice(), the random.choices() and
random.shuffle() functions. These four random generator functions are what make
the Robomaster S1 come to life and appear to have a mind of its own.
To avoid damaging your Robomaster S1, never set any speeds higher than they
are shown here, especially in smaller play areas. Note: be cautious when setting
the drive_speed variable higher than 0.3 and the seconds variable, who's default
is 2 seconds per drive time distance.
IMPORTANT! Never pick up or move the Robomaster S1, while its program is
running. Doing so may cause damage to the unit; you must stop the program first.
Robomaster S1 feature functions illustrated here are as follows:
Robomster S1 Comes to Life Function with sound effect
Robot All Wheel Omn directional Drive Function
Gimbal Free Mode Right Left Function
Chassis Follow Gimbal Right Left Function
Dance Rock Function
Blaster Fire Function with sound effect
Scan Search Right Left Function with sound effect
Sleep Function
Single Led Chassis Follow Gimbal Rotation Right Left Function
Double Led Chassis Follow Gimbal Rotation Right Left Function
Quad Led Gimbal Rotation Up Down Function with sound effect
RGB Colour Trail Chasers Forward Reverse Function
RGB Colour Changers Forward Reverse Function
RGB Flash Colour Changers Function
RGB Colour Flasher Functions
RGB Colour Flipper Functions
RGB Colour Dimmer Functions
User Interaction Features:
Detection Applause
Hit Detection
Please note: new and improved features and updates will always
continue to grow as I learn more, each and every day.
I sure hope other Robomaster S1 people find this program very
enjoyable and useful. I sure put a lot of time into creating it.
It sure wasn't no cakewalk when the gimbal and chassis would conflict
each other during practice execution/runs before I finally figured it
all out. So please enjoy...
robot_set_mode=robot_ctrl.set_mode
gimbal=gimbal_ctrl
chassis=chassis_ctrl
media=media_ctrl
armor=armor_ctrl
led=led_ctrl
define=rm_define
led_set_flash=led_ctrl.set_flash
led_set_single=led.set_single_led
led_set_top_bottom=(
led_ctrl.set_top_led,
led_ctrl.set_bottom_led)
gun_led_on_off=(
led_ctrl.gun_led_off,
led.gun_led_on)
define_armor_all=rm_define.armor_all
define_armor_top_bottom_all=(
rm_define.armor_top_all,
rm_define.armor_bottom_all)
define_armor_top_right_left=(
rm_define.armor_top_right,
rm_define.armor_top_left)
define_armor_bottom_right_left=(
rm_define.armor_bottom_right,
rm_define.armor_bottom_left)
define_armor_bottom_front_back=(
rm_define.armor_bottom_front,
rm_define.armor_bottom_back)
define_effect=(
rm_define.effect_always_off,
rm_define.effect_always_on,
rm_define.effect_flash,
rm_define.effect_breath,
rm_define.effect_marquee)
media_enable_disable=(
media_ctrl.disable_sound_recognition,
media_ctrl.enable_sound_recognition)
media_wait=media_ctrl.cond_wait
media_play_sound=media_ctrl.play_sound
define_detection_applause=(
rm_define.sound_detection_applause)
define_sound_recognized_twice_thrice=(
rm_define.cond_sound_recognized_applause_twice,
rm_define.cond_sound_recognized_applause_thrice)
armor_set_sensitivity=(armor_ctrl.set_hit_sensitivity)
wheel_degree=0,180,90,-90,45,-45,135,-135
l1,l2=0,255;blink_rate=2,3,4,5,6,8
scan_speed=50;drive_speed=.3
rotate_speed=20,30,40,50,60,80
seconds,milli_seconds=2,.2
delay1,delay2,delay3=1,.1,.05
a,b,c,x,y=1,2,3,1,-1
RGB_COLOURS=[
[], # empty list box
[l2,l2,l2], # RGB White
[l2,l1,l1], # RGB Red
[l2,l2,l1], # RGB Yellow
[l1,l1,l2], # RGB Blue
[l1,l2,l1], # RGB Green
[l2,l1,l2], # RGB Pink
[l1,l2,l2], # RGB Cyan
]
RGB_RY=[
[], # empty list box
[l2,l1,l1], # RGB Red
[l2,l2,l1], # RGB Yellow
[l2,l1,l1], # RGB Red
[l2,l2,l1], # RGB Yellow
[l2,l1,l1], # RGB Red
[l2,l2,l1], # RGB Yellow
[l2,l1,l1], # RGB Red
[l2,l2,l1], # RGB Yellow
]
RGB_YR=[
[], # empty list box
[l2,l2,l1], # RGB Yellow
[l2,l1,l1], # RGB Red
[l2,l2,l1], # RGB Yellow
[l2,l1,l1], # RGB Red
[l2,l2,l1], # RGB Yellow
[l2,l1,l1], # RGB Red
[l2,l2,l1], # RGB Yellow
[l2,l1,l1], # RGB Red
]
RGB_BG=[
[], # empty list box
[l1,l1,l2], # RGB Blue
[l1,l2,l1], # RGB Green
[l1,l1,l2], # RGB Blue
[l1,l2,l1], # RGB Green
[l1,l1,l2], # RGB Blue
[l1,l2,l1], # RGB Green
[l1,l1,l2], # RGB Blue
[l1,l2,l1], # RGB Green
]
RGB_GB=[
[], # empty list box
[l1,l2,l1], # RGB Green
[l1,l1,l2], # RGB Blue
[l1,l2,l1], # RGB Green
[l1,l1,l2], # RGB Blue
[l1,l2,l1], # RGB Green
[l1,l1,l2], # RGB Blue
[l1,l2,l1], # RGB Green
[l1,l1,l2], # RGB Blue
]
RGB_PC=[
[], # empty list box
[l2,l1,l2], # RGB Pink
[l1,l2,l2], # RGB Cyan
[l2,l1,l2], # RGB Pink
[l1,l2,l2], # RGB Cyan
[l2,l1,l2], # RGB Pink
[l1,l2,l2], # RGB Cyan
[l2,l1,l2], # RGB Pink
[l1,l2,l2], # RGB Cyan
]
RGB_CP=[
[], # empty list box
[l1,l2,l2], # RGB Cyan
[l2,l1,l2], # RGB Pink
[l1,l2,l2], # RGB Cyan
[l2,l1,l2], # RGB Pink
[l1,l2,l2], # RGB Cyan
[l2,l1,l2], # RGB Pink
[l1,l2,l2], # RGB Cyan
[l2,l1,l2], # RGB Pink
]
RGB_RYBG=[
[], # empty list box
[l2,l1,l1], # RGB Red
[l2,l2,l1], # RGB Yellow
[l1,l1,l2], # RGB Blue
[l1,l2,l1], # RGB Green
[l2,l1,l1], # RGB Red
[l2,l2,l1], # RGB Yellow
[l1,l1,l2], # RGB Blue
[l1,l2,l1], # RGB Green
]
def start():
gun_led_on_off0
media_enable_disable1
armor_set_sensitivity(10)
Robomster S1 Comes to Life Function:
Robot All Wheel Omni Directional Drive Function:
Gimbal Free Mode Right Left Function:
Chassis Follow Gimbal Right Left Function:
Dance Rock Function:
Blaster Fire Function:
Scan Search Right Left Function:
Sleep Function:
Single Led Chassis Follow Gimbal Rotation Right Left Function:
Double Led Chassis Follow Gimbal Rotation Right Left Function:
Quad Led Gimbal Rotation Up Down Function:
RGB Colour Trail Chasers Forward Reverse Function:
RGB Colour Changers Forward Reverse Function:
RGB Flash Colour Changers Function:
RGB Colour Flasher Functions:
RGB Colour Flipper Functions:
RGB Colour Dimmer Functions:
def armor_hit_detection_all(msg):
media.play_sound(
define.media_sound_attacked,
wait_for_complete_flag=True)
Beta Was this translation helpful? Give feedback.
All reactions