resistor_logic.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #ifndef RESISTOR_LOGIC_HEADERS
  2. #define RESISTOR_LOGIC_HEADERS
  3. typedef enum { R3 = 3, R4 = 4, R5 = 5, R6 = 6 } ResistorType;
  4. typedef enum {
  5. BandBlack = 0,
  6. BandBrown = 1,
  7. BandRed = 2,
  8. BandOrange = 3,
  9. BandYellow = 4,
  10. BandGreen = 5,
  11. BandBlue = 6,
  12. BandPurple = 7,
  13. BandGray = 8,
  14. BandWhite = 9,
  15. BandGold = 10,
  16. BandSilver = 11
  17. } BandColour;
  18. extern const int CHARS_NUMERIC;
  19. extern const int CHARS_MULTIPLIER;
  20. extern const int CHARS_TOLERANCE;
  21. extern const int CHARS_TEMP_COEFF;
  22. extern const int CHARS_CALCULATION;
  23. BandColour
  24. alter_resistor_band(ResistorType rtype, int band, BandColour current_colour, int direction);
  25. char* get_colour_short_description(BandColour colour);
  26. bool has_tolerance(ResistorType rtype);
  27. bool has_temp_coeff(ResistorType rtype);
  28. void update_resistance_calculation(ResistorType rtype, BandColour bands[], char string[]);
  29. void update_resistance_tolerance(ResistorType rtype, BandColour colours[], char string[]);
  30. void update_resistance_temp_coeff(ResistorType rtype, BandColour colours[], char string[]);
  31. #endif