awesome
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

catdogmousetv.ino 1.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. #include <TVout.h>
  2. #include <fontALL.h>
  3. TVout TV;
  4. unsigned char x,y;
  5. int toggle_3;
  6. int toggle_2;
  7. int toggle_1;
  8. char poetry;
  9. char animal1[] = "cat";
  10. char animal2[] = "dog";
  11. char animal3[] = "mouse";
  12. char animal4[]= "cockroach";
  13. char str[] = "hello";
  14. char str2[] = "CAT";
  15. char str3[] = "BARK";
  16. String str4 = "booomaaar";
  17. const byte NUMBER_OF_NAMES = 7;
  18. char *names[NUMBER_OF_NAMES] = {
  19. "BOB0",
  20. "BOB1",
  21. "BOB2",
  22. "BOB3 ",
  23. "BOB4",};
  24. const byte greet = 4;
  25. char *greets[greet] = {
  26. " Hello ",
  27. " Hi ",
  28. " hey ",
  29. " ayyy ",};
  30. void setup() {
  31. // put your setup code here, to run once:
  32. x=0;
  33. y=0;
  34. TV.begin(_NTSC,120,96);
  35. TV.select_font(font6x8);
  36. }
  37. void loop() {
  38. // put your main code here, to run repeatedly:
  39. toggle_2 = analogRead(2);
  40. if (toggle_2 < 250) {
  41. TV.println(animal1); //print cat
  42. TV.delay(100);
  43. }
  44. else if(toggle_2 >250 && toggle_2 <350){
  45. TV.println(animal2); //print dog
  46. TV.delay(100);
  47. }
  48. else if(toggle_2 >350 && toggle_2 <500){
  49. TV.println(animal2); //print dog 2
  50. TV.delay(100);
  51. }
  52. else if(toggle_2 >500 && toggle_2 <750){
  53. TV.println(animal3); //print mouse
  54. TV.delay(100);
  55. }
  56. else if(toggle_2 >750){
  57. TV.println(animal4); //print cockroach
  58. TV.delay(100);
  59. }
  60. delay(200);
  61. toggle_1 = analogRead(1);
  62. if (toggle_1 < 250) {
  63. TV.println(&str[4]); //prints "o"
  64. TV.println(&str[3]);// prints "lo"
  65. TV.delay(100);
  66. }
  67. else if(toggle_1 >250 && toggle_1 <500){
  68. TV.print(&str[3]); //prints "lo"
  69. TV.print(&str2[1]); // prints "AT"
  70. TV.delay(100);
  71. TV.print(&str3[3]); //prints "K"
  72. TV.print(&str3[0]); // prints "AT"
  73. }
  74. else if(toggle_1 >500 && toggle_1 <750){
  75. TV.println(&str[0]); // prints "hello"
  76. TV.delay(100);
  77. }
  78. else if(toggle_1 >750){
  79. TV.print(str[2]); // prints "llo"
  80. TV.print(str2[0]); // prints "CAT"
  81. TV.delay(100);
  82. }
  83. }