bugs
This commit is contained in:
		
							parent
							
								
									3fb557dd4a
								
							
						
					
					
						commit
						c092d631b2
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		
							
								
								
									
										2
									
								
								main.py
									
										
									
									
									
								
							
							
						
						
									
										2
									
								
								main.py
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -52,7 +52,7 @@ def main(device_path, dest_ip, dest_port):
 | 
			
		|||
                    # The format string 'HH' specifies two unsigned short integers (u16).
 | 
			
		||||
                    # The '<' character ensures little-endian byte order.
 | 
			
		||||
                    try:
 | 
			
		||||
                        packet = struct.pack('<HH', (float(x_coor)/32767.0)*1920, (float(y_coor)/32767.0)*1080)
 | 
			
		||||
                        packet = struct.pack('<HH', int((float(x_coor)/32767.0)*1920), int((float(y_coor)/32767.0)*1080))
 | 
			
		||||
                        
 | 
			
		||||
                        # Send the packet over UDP
 | 
			
		||||
                        sock.sendto(packet, (dest_ip, dest_port))
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue