11import time
2- import random
32import os
43from pymycobot .mycobot import MyCobot
54from pymycobot .genre import Angle , Coord
109def test (mycobot ):
1110 print ("\n Start check basic options\n " )
1211
13- color_name = ["red" , "green" , "blue" ]
14- color_code = ["ff0000" , "00ff00" , "0000ff" ]
15- i = random .randint (0 , len (color_code ) - 1 )
16- mycobot .set_led_color (color_code [i ])
17- print ("::set_led_color() ==> color {}\n " .format (color_name [i ]))
12+ mycobot .set_color (255 , 255 , 0 )
13+ print ("::set_color() ==> color {}\n " .format ("255 255 0" ))
1814 time .sleep (3 )
1915
2016 angles = [0 , 0 , 0 , 0 , 0 , 0 ]
@@ -39,7 +35,8 @@ def test(mycobot):
3935
4036 coords = [160 , 160 , 160 , 0 , 0 , 0 ]
4137 mycobot .send_coords (coords , 70 , 0 )
42- print ("::send_coords() ==> send coords {}, speed 70, mode 0\n " .format (coords ))
38+ print ("::send_coords() ==> send coords {}, speed 70, mode 0\n " .format (
39+ coords ))
4340 time .sleep (3 )
4441
4542 print ("::get_coords() ==> coords {}\n " .format (mycobot .get_coords ()))
@@ -58,8 +55,7 @@ def test(mycobot):
5855
5956
6057if __name__ == "__main__" :
61- print (
62- """
58+ print ("""
6359--------------------------------------------
6460| This file will test basic option method: |
6561| set_led_color() |
@@ -73,8 +69,7 @@ def test(mycobot):
7369| send_coord() |
7470| set_free_mode() |
7571--------------------------------------------
76- """
77- )
72+ """ )
7873 time .sleep (3 )
7974 # port = subprocess.check_output(['echo -n /dev/ttyUSB*'],
8075 # shell=True).decode()
0 commit comments