Browse Source

working on it

master
Slayr 1 year ago
parent
commit
d388a93b7b

+ 9
- 0
sketches/my_sk_sandra/prototype-mega/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

+ 195
- 0
sketches/my_sk_sandra/prototype-mega/prototype-mega.ino View File

@@ -0,0 +1,195 @@
1
+#include <TVout.h>
2
+#include <fontALL.h>
3
+
4
+int incomingByte = 0; // for incoming serial data
5
+
6
+TVout TV;
7
+unsigned char x,y;
8
+
9
+int zOff = 150;
10
+int xOff = 0;
11
+int yOff = 0;
12
+int cSize = 50;
13
+int view_plane = 64;
14
+float angle = PI/60;
15
+
16
+int toggle_0;
17
+int toggle_1;
18
+int toggle_2;
19
+int toggle_3;
20
+int toggle_4;
21
+int toggle_5;
22
+
23
+const char *animals[] = {
24
+  "cat", 
25
+  "dog", 
26
+  "mouse", 
27
+  "cockroach"
28
+  }; //A0
29
+
30
+const char *BOBZ[] = {
31
+ "BOB0",
32
+ "BOB1",
33
+ "BOB2",
34
+ "BOB3",
35
+ "BOB4",
36
+ "BOB5",
37
+ "BOB6"
38
+ }; //A1
39
+
40
+const char *greets[] = {
41
+ "alone",
42
+ "Hi",
43
+ "hey",
44
+ "ayyy"}; //A2
45
+
46
+const byte letter = 10;
47
+ char *letters[letter] = {
48
+ "RUFF","A","B","C","D","RUDE","E","F","G","BAD"}; 
49
+
50
+
51
+char str[] = "hello"; 
52
+char str2[] = "at night they";
53
+char str3[] = "day";
54
+const char *words[] = {&str[3], &str2[0], &str3[1]}; //A3
55
+
56
+
57
+const int BUTTON1 = 44;
58
+const int BUTTON2 = 45;
59
+const int BUTTON3 = 46;
60
+const int BUTTON4 = 47;
61
+const int BUTTON5 = 48;
62
+const int BUTTON6 = 49;
63
+const int BUTTON7 = 50;
64
+const int BUTTON8 = 51;
65
+const int BUTTON9 = 52;
66
+
67
+
68
+int val1= 0;
69
+int val2= 0;
70
+int val3= 0;
71
+int val4= 0;
72
+int val5= 0;
73
+int val6= 0;
74
+int val7= 0;
75
+int val8= 0;
76
+int val9= 0;
77
+
78
+
79
+void setup() {
80
+  Serial.begin(9600);
81
+  TV.begin(PAL);
82
+  TV.select_font(font4x6);
83
+  pinMode(BUTTON1, INPUT);
84
+  pinMode(BUTTON2, INPUT);
85
+  pinMode(BUTTON3, INPUT);
86
+  pinMode(BUTTON4, INPUT);
87
+  pinMode(BUTTON5, INPUT);
88
+  pinMode(BUTTON6, INPUT);
89
+  pinMode(BUTTON7, INPUT);
90
+  pinMode(BUTTON8, INPUT);
91
+  pinMode(BUTTON9, INPUT);
92
+  
93
+}
94
+
95
+void loop() {
96
+
97
+toggle_0 = analogRead(A0);
98
+toggle_1 = analogRead(A1);
99
+toggle_2 = analogRead(A2);
100
+toggle_3 = analogRead(A3);
101
+toggle_4 = analogRead(A4);
102
+toggle_5 = analogRead(A5);
103
+
104
+val1 = digitalRead(BUTTON1);
105
+val2 = digitalRead(BUTTON2);
106
+val3 = digitalRead(BUTTON3);
107
+val4 = digitalRead(BUTTON4);
108
+val5 = digitalRead(BUTTON5);
109
+val6 = digitalRead(BUTTON6);
110
+val7 = digitalRead(BUTTON7);
111
+val8 = digitalRead(BUTTON8);
112
+val9 = digitalRead(BUTTON9);
113
+
114
+
115
+
116
+
117
+if (val1 == HIGH) {
118
+  TV.select_font(font4x6);
119
+  TV.print("POETRY");
120
+  Serial.print("POETRY");
121
+  TV.draw_line(60,20,60,76,WHITE);
122
+}
123
+
124
+ 
125
+  if (val2 == HIGH) {
126
+  TV.select_font(font6x8);
127
+  TV.print("blah");
128
+  TV.draw_line(20,20,60,76,WHITE);
129
+
130
+  if(toggle_3 < 500){
131
+  TV.print("AFLY",10,10);
132
+}
133
+  }
134
+
135
+  if (val3 == HIGH) {
136
+  for (int i=0; i<TV.hres(); i++) {
137
+  TV.print(i,44,F("cigarette"));
138
+  TV.select_font(font8x8ext);
139
+  TV.print(i,i,F("TTTTTTTTTTTTTT"));
140
+  TV.delay(200);
141
+}
142
+  }
143
+
144
+  if (val4 == HIGH) {
145
+  TV.print(letters[random(0,letter)]);
146
+  TV.select_font(font4x6);
147
+  TV.print(10,10,F("good evening"));
148
+  TV.draw_rect(20,20,33,76,0,0);
149
+  TV.draw_line(20,20,33,76,1);
150
+  TV.clear_screen();
151
+}
152
+
153
+if (val5 == HIGH) {
154
+TV.print((char)Serial.read());
155
+TV.delay(20);
156
+}
157
+
158
+if (val6 == HIGH) {
159
+TV.print(letters[random(0,letter)]);
160
+}
161
+
162
+ if(toggle_4 >500){
163
+      
164
+  int animal; //animals
165
+  animal = map(toggle_0, 0, 1023, 0, 3);
166
+  TV.print(animals[animal]);
167
+  delay(10);
168
+
169
+  int BOB; //BOBZ
170
+  BOB = map(toggle_1, 0, 1023, 0, 6);
171
+  TV.print(BOBZ[BOB]);
172
+  delay(10);
173
+  
174
+  int w1; //words
175
+  w1 = map(toggle_2, 0, 1023, 0, 2);
176
+  TV.print(words[w1]);
177
+  delay(10);
178
+
179
+  if(toggle_5 <100){
180
+    TV.print(10,10,F("good evening"));
181
+  }
182
+  
183
+  else if(toggle_5>200 & toggle_5<500){
184
+    TV.print(30,50,F("where are you going"));
185
+  }
186
+}
187
+   else if(toggle_4 <100){
188
+   TV.print("7");  
189
+   }
190
+
191
+  //else {
192
+   // TV.delay(20);
193
+   //}
194
+    
195
+}

Loading…
Cancel
Save