想到十年前刚用qq的时候有个倒计时表情包            有个惊喜!-10-9-8-7-6-5-4-3-2-1-0-哈哈什么都没有!.gif



import os
import sys
import timetry:from PIL import Image
except ImportError:sys.exit("Cannot import from PIL: Do `pip3 install --user Pillow` to install")import cozmodef get_in_position(robot: cozmo.robot.Robot):'''If necessary, Move Cozmo's Head and Lift to make it easy to see Cozmo's face'''if (robot.lift_height.distance_mm > 45) or (robot.head_angle.degrees < 40):with robot.perform_off_charger():lift_action = robot.set_lift_height(0.0, in_parallel=True)head_action = robot.set_head_angle(cozmo.robot.MAX_HEAD_ANGLE,in_parallel=True)lift_action.wait_for_completed()head_action.wait_for_completed()def cozmo_program(robot: cozmo.robot.Robot):current_directory = os.path.dirname(os.path.realpath(__file__))get_in_position(robot)surprise_png = os.path.join(current_directory, "..", "..", "face_images", "surprise.png")five_png = os.path.join(current_directory, "..", "..", "face_images", "5.png")four_png = os.path.join(current_directory, "..", "..", "face_images", "4.png")three_png = os.path.join(current_directory, "..", "..", "face_images", "3.png")two_png = os.path.join(current_directory, "..", "..", "face_images", "2.png")one_png = os.path.join(current_directory, "..", "..", "face_images", "1.png")zero_png = os.path.join(current_directory, "..", "..", "face_images", "0.png")none_png = os.path.join(current_directory, "..", "..", "face_images", "none.png")# load some images and convert them for display cozmo's faceimage_settings = [(surprise_png, Image.BICUBIC),(five_png, Image.BICUBIC),(four_png, Image.BICUBIC),(three_png, Image.BICUBIC),(two_png, Image.BICUBIC),(one_png, Image.BICUBIC),(zero_png, Image.BICUBIC),(none_png, Image.NEAREST)] face_images = []for image_name, resampling_mode in image_settings:image = Image.open(image_name)# resize to fit on Cozmo's face screenresized_image = image.resize(cozmo.oled_face.dimensions(), resampling_mode)# convert the image to the format used by the oled screenface_image = cozmo.oled_face.convert_image_to_screen_data(resized_image,invert_image=True)face_images.append(face_image)num_loops = 1duration_s = 1.0print("Press CTRL-C to quit (or wait %s seconds to complete)" % int(num_loops*duration_s) )for _ in range(num_loops):for image in face_images:robot.display_oled_face_image(image, duration_s * 1000.0)time.sleep(duration_s)cozmo.robot.Robot.drive_off_charger_on_connect = Falsecozmo.run_program(cozmo_program)

ps.图片就是普通的截图。

cozmo玩耍记录2-倒计时整蛊相关推荐

  1. cozmo玩耍记录1

    我也不知道这算什么,姑且称之为--走个T台? 看了cozmo sdk里面01_basics的例子后,可以按头让cozmo做点什么了. 想具体了解01_basics例子的朋友可以移步zhangrelay ...

  2. 手机上有哪些可以记录生日倒计时天数的软件?

    现如今很多人喜欢将一些比较重要的事情记录在手机的便签或者备忘录软件中,设置上时间提醒,让提醒软件实时的提醒自己按时来完成一些比较重要的事情,但是并不是所有的手机提醒软件均支持设置倒计时天数提醒,而且每 ...

  3. 手机记录生日倒计时软件排行榜里哪个便签比较好用

    在快节奏的社会里,人们忙起工作来总会忘记自己的生日.很多时候自己的生日都过去好几天了,才想起来自己的生日.有的人还要记录朋友的生日.亲戚的生日.客户的生日.公司员工的生日等等.要记录的生日很多,可自己 ...

  4. android 倒计时 动画下载,倒计时器app下载-倒计时器安卓最新版-幻想游戏网

    倒计时器app还有二次元的壁纸,相信你已经迫不及待了,等你来发掘,提供倒计时功能,需要的用户欢迎来本站点击下载. 倒计时器功能 动画效果: 界面采用动画主题效果,增加生动的气息 可自定义小组件背景,自 ...

  5. h5倒计时弹窗_H5活动开始/结束倒计时实现

    最近在做一个活动页,根据后台返回的活动开始时间.结束时间判断当前活动的状态以及实现倒计时 效果,上一篇文章有记录ios倒计时踩坑,这里记录下倒计时效果实现. 倒计时效果 js: /**获取现在的时间* ...

  6. Android:安卓实现高考倒计时功能

    本人安卓菜鸟,因为学校有一个比赛,所以正在做一个面向高中生的APP. 今天就是来记录一下倒计时功能的实现. 一.我首先做了一个类似下拉框的效果,让用户自己选择自己的年级(高一/高二/高三),然后根据相 ...

  7. CountDownTimer 一步实现最简单的倒计时控件

    最近做倒计时领取红包功能,用到倒计时功能,由于不需要太精确,所以选择了系统提供的CountDownTimer实现倒计时功能. 1 CountDownTimer CountDownTimer是Googl ...

  8. Javascript实战——电子钟(时钟、闹钟、计时器、倒计时)

    1.效果图 2.源代码 <!DOCTYPE html><head><meta charset="utf-8"><title>电子钟& ...

  9. 短信验证码60倒计时

    export default {data () {return {btnColor: '#ea5504',content: '发送验证码', // 按钮里显示的内容totalTime: 90, // ...

最新文章

  1. MySQL设值自动修改时间
  2. 双11,如果数据中心断网断电会怎样?
  3. 盘点Win10系统的实用“小设计”
  4. 将MongoDB与Morphia结合使用
  5. 跨境电商独立站建站优化清单
  6. PyCharm汉化后无法打开Settings设置
  7. 你凭什么被叫做程序员?
  8. 【广度优先搜索】一个实例+两张动图彻底理解 BFS | 思路+代码详解 | 用 DFS 自动控制我们的小游戏
  9. LeetCode 116/117 填充每个节点下一个右侧指针
  10. impala查询语句_impala 下的SQL操作
  11. Laravel nginx 伪静态规则
  12. 敏捷需求描述:用户故事
  13. 解密拼多多800元裂变营销新方法
  14. 自从我使用HiFlow场景连接器后,在也不用担心成为“落汤鸡”了
  15. 读书之乐 摘自《致青年朋友》
  16. 思必驰宣布完成5亿元D轮融资 继续深化AI生态布局
  17. 转行网络工程师,软考和华为认证选哪个?
  18. cpu选择K还是f?哪个更靠谱?
  19. 区块链之一 起源思想和本质
  20. Google Adwords新手快速入门教程

热门文章

  1. FEDformer里面的CZ1d
  2. 分享插件 jiaThis
  3. mysql decimal长度_mysql decimal类型与decimal长度用法详解
  4. Windows下DOS 方式进入D盘文件夹
  5. Ubuntu 解决中文乱码问题
  6. 排序函数(sort、sorted、argsort、lexsort、partition、argpartition、searchsorted)
  7. 全球移动互联网大会北京站第二日感受分享
  8. 【学习笔记】Golang语法学习笔记
  9. 日常生活英语单词大全(转)
  10. 自己动手做自动发布系统二