In some cases, yes, a defense of necessity may be available if you violated traffic laws in order to avoid some other type of harm. For example, if you were speeding to get to the hospital with a sick person in your vehicle or if you swerved across traffic in order to avoid hitting a pedestrian, we can fight the traffic ticket based on the emergency situation.