update 增加速度设置,点位比对,启动警报等
This commit is contained in:
17
test_ui.py
17
test_ui.py
@ -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))
|
||||
|
||||
Reference in New Issue
Block a user