Advertisement
Guest User

Untitled

a guest
Nov 27th, 2014
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.63 KB | None | 0 0
  1.  
  2. // CS207 Lab Test Template 4
  3. // Name:
  4. // Student Number:
  5.  
  6. #include <EEPROM.h>
  7. #include <CapSense.h>
  8.  
  9.  
  10. const int data = 4;
  11. const int latch = 7;
  12. const int clock = 8;
  13. const int button1 = 10;
  14. const int button2 = 11;
  15. const int button3 = 12;
  16. const int slider1 = A2;
  17. const int slider2 = A1;
  18. const int slider3 = A0;
  19. const int buzzer = 3;
  20. const int LDR = A3;
  21. const int LED1 = 5;
  22. const int LED2 = 6;
  23.  
  24. //Initialize CapSense object
  25. CapSense cs_9_2 = CapSense(9,2);
  26.  
  27. void setup()
  28. {
  29. pinMode(data, OUTPUT);
  30. pinMode(latch, OUTPUT);
  31. pinMode(clock, OUTPUT);
  32.  
  33. //Configures buttons for internal pull-up
  34. pinMode(button1, INPUT);
  35. pinMode(button2, INPUT);
  36. pinMode(button3, INPUT);
  37. digitalWrite(button1, HIGH);
  38. digitalWrite(button2, HIGH);
  39. digitalWrite(button3, HIGH);
  40.  
  41. // Turn off capsense object autocalibration
  42. cs_9_2.set_CS_AutocaL_Millis(0xFFFFFFFF);
  43.  
  44. }
  45.  
  46. int numberGlyphs[] =
  47. {
  48. B11000000, //0
  49. B11111001, //1
  50. B10100100, //2
  51. B10110000, //3
  52. B10011001, //4
  53. B10010010, //5
  54. B10000010, //6
  55. B11111000, //7
  56. B10000000, //8
  57. B10011000, //9
  58. B11111111, //10 - CLEAR
  59. };
  60.  
  61. int endSongNotes[36] = { 262, 0, 392, 0, 349, 0, 330, 0, 294, 0, 523, 0, 392, 0, 349, 0, 330, 0, 294, 0, 523, 0, 392, 0, 349, 0, 330, 0, 349, 0, 294, 0, 262, 0, 262, 0 };
  62. int endSongTimes[36] = { 1100, 100, 500, 100, 100, 100, 100, 100, 100, 100, 1100, 100, 500, 100, 100, 100, 100, 100, 100, 100, 1100, 100, 500, 100, 100, 100, 100, 100, 100, 100, 1500, 100, 100, 100, 100, 100 };
  63.  
  64.  
  65. void loop()
  66. {
  67.  
  68. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement