Skip to content

Commit a80c1a7

Browse files
committed
⚠️ change bit math
1 parent f3c4bda commit a80c1a7

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

send_to_ai.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,11 @@ func RunServer(chserver chan bool, MyID uint32) {
8888

8989
for {
9090
// 左から1ビットだけを取り出す
91-
detectPhotoSensor := 0b10000000&recvdata.SensorInformation != 0
91+
detectPhotoSensor := 0b00000001&recvdata.SensorInformation != 0
9292
// 左から2ビット目だけを取り出す
93-
detectDribblerSensor := 0b01000000&recvdata.SensorInformation != 0
93+
detectDribblerSensor := 0b00000010&recvdata.SensorInformation != 0
9494
// 左から3ビット目だけを取り出す
95-
isNewDribbler := 0b00100000&recvdata.SensorInformation != 0
95+
isNewDribbler := 0b00000100&recvdata.SensorInformation != 0
9696

9797
pe := createStatus(uint32(MyID), detectPhotoSensor, detectDribblerSensor, isNewDribbler, uint32(recvdata.Volt), uint32(recvdata.CapPower), imageData.Is_ball_exit, imageData.Image_x, imageData.Image_y, minThreshold, maxThreshold, int32(ballDetectRadius), circularityThreshold)
9898
Data, _ := proto.Marshal(pe)

0 commit comments

Comments
 (0)