Browse Source

catdogmouse tvout draft

master
Slayr 1 year ago
parent
commit
4b1397dd9e

+ 108
- 0
sketches/my_sk_sandra/catdogmousetv/catdogmousetv.ino View File

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

+ 9
- 0
sketches/my_sk_sandra/catdogmousetv/fontALL.h View File

@@ -0,0 +1,9 @@
1
+#ifndef FONTALL_H
2
+#define FONTALL_H
3
+
4
+#include "TVoutfonts/font4x6.h"
5
+#include "TVoutfonts/font6x8.h"
6
+#include "TVoutfonts/font8x8.h"
7
+#include "TVoutfonts/font8x8ext.h"
8
+
9
+#endif

Loading…
Cancel
Save