from picarmini import dir_servo_angle_calibration from picarmini import set_camera_servo2_angle from ezblock import delay from ezblock import TTS from picarmini import camera_servo1_angle_calibration from picarmini import camera_servo2_angle_calibration from ezblock import WiFi __tts__ = TTS() Vilib.camera_start(True) Vilib.human_detect_switch(True) dir_servo_angle_calibration(0) camera_servo1_angle_calibration(0) camera_servo2_angle_calibration(0) WiFi().write('DE', 'Projesh', 'Syepto17') def forever(): if (Vilib.human_detect_object(('number'))) >= 1: set_camera_servo1_angle(30) delay(150) set_camera_servo1_angle((-30)) delay(150) set_camera_servo2_angle(0) delay(150) __tts__.say('Hello,nice to meet projesh!') if __name__ == "__main__": while True:
from picarmini import camera_servo2_angle_calibration from ezblock import WiFi with open('config.json', 'r') as configuration: data = configuration.read() obj = json.loads(data) __tts__ = TTS() Vilib.camera_start(True) Vilib.human_detect_switch(True) dir_servo_angle_calibration(0) camera_servo1_angle_calibration(0) camera_servo2_angle_calibration(0) WiFi().write(str(obj['country']), str(obj['ssid']), str(obj['key'])) def forever(): if (Vilib.human_detect_object(('number'))) >= 1: set_camera_servo2_angle(30) delay(150) set_camera_servo2_angle((-30)) delay(150) set_camera_servo2_angle(0) delay(150) __tts__.say('Hello,nice to meet you!') if __name__ == "__main__": while True:
from picarmini import forward from picarmini import stop from ezblock import WiFi x_axis = None width = None pan_angle = None Vilib.detect_color_name('red') Vilib.color_detect_switch(True) Vilib.camera_start(True) pan_angle = 0 dir_servo_angle_calibration(0) camera_servo1_angle_calibration(0) camera_servo2_angle_calibration(0) WiFi().write('CN', 'MakerStarsHall', 'sunfounder') def forever(): global x_axis, width, pan_angle x_axis = Vilib.color_detect_object('x') width = Vilib.color_detect_object('width') delay(5) if x_axis == -1: pan_angle = pan_angle - 1 pan_angle = constrain(pan_angle, -90, 90) set_camera_servo1_angle(pan_angle) pan_angle = constrain(pan_angle, -45, 45) set_dir_servo_angle(pan_angle) elif x_axis == 1: pan_angle = pan_angle + 1
from picarmini import dir_servo_angle_calibration from picarmini import set_camera_servo2_angle from ezblock import delay from ezblock import TTS from picarmini import camera_servo1_angle_calibration from picarmini import camera_servo2_angle_calibration from ezblock import WiFi __tts__ = TTS() Vilib.camera_start(True) Vilib.human_detect_switch(True) dir_servo_angle_calibration(0) camera_servo1_angle_calibration(0) camera_servo2_angle_calibration(0) WiFi().write('CN', 'lemons', 'Osu@2021') def forever(): if (Vilib.human_detect_object(('number'))) >= 1: set_camera_servo2_angle(30) delay(150) set_camera_servo2_angle((-30)) delay(150) set_camera_servo2_angle(0) delay(150) __tts__.say('Hello,nice to meet you!') if __name__ == "__main__": while True: