update 增加速度设置,点位比对,启动警报等

This commit is contained in:
FrankCV2048
2024-12-05 20:29:27 +08:00
parent a884e241d3
commit 6f22ef051a
10 changed files with 795 additions and 640 deletions

View File

@ -1,3 +1,14 @@
my_list = [1, 2, 3, 4, 5]
list_slice = list(reversed(my_list[:2]))
print(list_slice) # 输出: [5, 4, 3, 2, 1]
output_n = 7
io_bit = 5
def is_bit_set(n, position):
"""
检查整数 n 的第 position 位是否为 1
:param n: 整数
:param position: 从右往左数的位0 表示最低位
:return: True 表示该位是 1否则为 False
"""
return (n >> position) & 1 == 1
print(is_bit_set(7,3))