detector-building

Arduino code and other resources for the 2021 Science Olympiad event Detector Building

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
  16. 16
  17. 17
  18. 18
  19. 19
  20. 20
  21. 21
  22. 22
  23. 23
  24. 24
  25. 25
  26. 26
  27. 27
  28. 28
  29. 29
  30. 30
  31. 31
/*
  detectorBuilding.h - Library for Detector Building utility functions
  Created by Anthony Wang, February 21, 2020.
  Released into the public domain.
*/

#ifndef detectorBuilding_h
#define detectorBuilding_h

#include "Arduino.h"
typedef long double ld;

const int LED_R = 8, LED_G = 10, LED_B = 12, THERM = 0; // Device component pins
const ld R_k = 10000, V_in = 5, analog_max = 1023; // Device constants

ld f2c(ld f);
ld c2f(ld c);
ld k2c(ld k);
ld c2k(ld c);
ld f2k(ld f);
ld k2f(ld k);

ld a2d(int a);
int d2a(ld d);

ld v2r(ld V_out);

void sort(ld a[], int n);

//void calculate();

#endif