a bit better
This commit is contained in:
		
							parent
							
								
									57b56d6e37
								
							
						
					
					
						commit
						84171424ea
					
				
					 1 changed files with 3 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -77,10 +77,10 @@ int main(int argc, char **argv) {
 | 
			
		|||
            }
 | 
			
		||||
        } else if (frame.can_id == 0x5a0) {
 | 
			
		||||
            /*
 | 
			
		||||
             * Speed is expressed in units of 0.002 wheel cycles per second
 | 
			
		||||
             * Speed is expressed in units of 0.001 wheel cycles per second
 | 
			
		||||
             */
 | 
			
		||||
            double rps = 0.001 * (double)(((uint16_t)frame.data[1] >> 1)
 | 
			
		||||
                                        | ((uint16_t)frame.data[2] << 8));
 | 
			
		||||
            double rps = 0.001 * (double)((frame.data[1] >> 1)
 | 
			
		||||
                                        | (frame.data[2] << 8));
 | 
			
		||||
 | 
			
		||||
            double kph = (2.032 * rps * 3600) / 1000.0;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue