Advertisement
Guest User

Untitled

a guest
Feb 8th, 2016
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. #undef ALLTIME_5V
  2.  
  3. #ifdef ALLTIME_5V
  4. #else
  5. if ((T >= MIN_TEMP) & (T <= MAX_TEMP))
  6. {
  7. if (FanStoped)
  8. {
  9. PWM_ = Max;
  10. FanStoped = 0;
  11. goto e1;
  12. }
  13. #endif
  14.  
  15. dP = Max - Min;
  16. if (T < MIN_TEMP)
  17. {
  18. T = MIN_TEMP;
  19. }
  20. T = T - MIN_TEMP;
  21. PWM_ = ((dP / DT) * T);
  22. PWM_ = PWM_ + Min;
  23. goto e1;
  24. }
  25.  
  26. #ifndef ALLTIME_5V
  27. if (T < MIN_TEMP)
  28. {
  29. PWM_ = 0;
  30. FanStoped = 1;
  31. }
  32. #endif
  33.  
  34. if (T > MAX_TEMP)
  35. {
  36. PWM_ = 255;
  37. FanStoped = 0;
  38. Beep();
  39. }
  40.  
  41. e1:
  42. OCR0A=PWM_;
  43. }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement