Looks like Robin's psuedocode is exactly what you need - turn on over 38, turn off under 34. Nice and simple.