-
Notifications
You must be signed in to change notification settings - Fork 3
/
WORKINGDOC-Dot-Matrix
138 lines (124 loc) · 12.2 KB
/
WORKINGDOC-Dot-Matrix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
//Dot Matrix Reader code
//Key Tool: https://www.dcode.fr/binary-image
//Notes: Need to make sure the scatter file has # characters matching WIDTH & HEIGHT broken down by deg/char.
//Need to normalize between MoM & PoP at cost of usable area. ~2 deg/character
//Uses Arduino serial reader Case seperator example. Run by pasting all 20k data points into serial monitor all at once.....Processing otherwise
//May need a 'shake algorythm' to enable smaller deg moves. MUST turn off backlash if so.
// BACKLASH CAUSES STACKED ERROR!!!!!!!!!!!!!
//Need algothrhym to lift & home occassionally to prevent problems.
//Test hypothesis by drwing an M FIRST
int WIDTH = ~120 total # characters wide of drawable area. X-axis
int HEIGHT = ~170 total # characters high of drawable area. Y-axis
double DegPerCharX= WIDTH/(XdMax - XdMin)
double DegPerCharY = HEIGHT/(YdMax - YdMin)
Setup
Home. (lift Z & go home position. )
Loop(){
WHILE (int i=0, i<=WIDTH, i++){
While (int j=0, j<=HEIGHT, j++){
Check array next character (i,j) Using the case algorythm
Draw Line to current i,j.
if 0:
do nothing.
if 1:
Drop Z, then Lift Z
if 'space'
break
//j++1
}
//i++1
}
//Kill motors;
//delay(99999999); //effectively making the loop onlly complete once
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000001100000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000001000001111111000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000100000000110000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000001000001000000000001000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000010000000000000000000100000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000100000000000000010000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000001000001000000000000000000100000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000010000000000000000000000000100000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000010000000000000000000000000010000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000110000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000011010000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000010011000010000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000100000000000000000001000000010000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000010100000000000000000010000000100100000000000000000000000000000000000000000000000000000
000000000000000000000000000000000010110000000000000000100000001000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000011000000000000000001000000010001000000000000000000000000000000000000000000000000000000
000000000000000000000000000000001100000000000000000001000000100000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000100000000000000000000010000001100010000000000000000000000000000000000000000000000000000000
000000000000000000000000000001000000010000000011001110000110001010000000000000000000000000000000000000000000000000000000
000000000000000000000000000000100000011110111111100000011000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000011111111001000111100000000000110001000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000001100000000110000000000001110000100000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000010000000000000000000000010000100000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000010110000011000000000000010000010000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000011010000011000000000000010000001000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000011110100011000000000000010000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000001000001000000000000001000011000010000000000000000000000000000000000000000000000000000
000000000000000000000000000000000001001110000000000000001000001001100000000000000000000000000000000000000000000000000000
000000000000000000000000000000000001110000000000100000000100000100000000000000000000000000000111111100000000000000000000
000000000000000000000000000000000110000000000011000000000010000000000000000000000000000000011000000001100000000000000000
000000000000000000000000000000010000000000001100000000000010000010000000000000000000000000100000000000010000000000000000
000000000000000000000000000100000000000000010000000000000010000001000000000000000000000010000000000000010000000000000000
000000000000000000000000000001000010000100000000001000000100000000000000000000000000000100000000000001000000000000000000
000000000000000000000000000010000010000100000000000000001000000000100000000000000000000000000000000100000000000000000000
000000000000000000000000000100000011111000000000000000100000000000000000000000000000001000000000011000000000000000000000
000000000000000000000000001011000000110000000001001000000000000001001100000000000000000000000000100000000000000000000000
000000000000000000000000001000000000000000000000100000000000000010010010000000000000010000000010000000000000000000000000
000000000000000000000000000010000000000000000001010000000000001000000000100000000000010000000100000000000000000000000000
000000000000000000000000000000000000000000000101110000000000010001000000001000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000111011000000001000010000000000110000000100000000010000000000000000000000000
000000000000000000000000000101000000000000000111010000000100000100000000000001100111100000000010000000000000000000000000
000000000000000000000000000110000000001000010101010000100000010000000000000001110000000000000001000000000000000000000000
000000000000000000000000000100010011000001000001010000000011000000000000001110000000000000000001000000000000000000000000
000000000000000000000000000000000010110010001000010000011000000000000011100000000000000000000000000000000000000000000000
000000000000000000000000000000001100000010001000001011000000000000111000000000000000000000000000100000000011110000000000
000000000000000000000000000000000111000000000000000100000000000111000000000000000000000000000000100000011100010000000000
000000000000000000000000000000000000000000000000000100000001110000000000000000000000000000000000010111000000010000000000
000000000000000000000000000000000000000000000000011000001110000000000000000000000000000000000000011000000000000000000000
000000011111000000000000000000110000000000000000010011100000000100000000000000000000000000000000000000000000100000000000
000000000000000000000000000000101000000000000000111000000000001000010000011100000000000000000000000110000000000000000000
000000000000010000000000000000110000000000010011001100000000001000000000100000000000010000011000010000000111000000000000
000000000100000100000000000001101100000001000000000000010000001010000001000000000000000001000000100000001000000000000000
000000000110000100000110001001001100000010010000101100010000000010000001001000010011001111000001100100001000000000000000
000000000001000000100000000001001000100010000000000000010000100010010000010000100011001010010000101001001001001100000000
000000000011001000000100000001001001010010000011000000110100001010010000000000100000000010010000100000011010000100000000
000000000100010001000101001001001000010110000110001011000100001010100010001000111101000000001101100100001000001101000000
000000000000001000000100000000001000000100011000000100010000001011000100000000110000000000000001000000001010101101000000
000000000000001001000000000000001101010000000010000001010100001000001111010010000000011000000000000001101110000101000000
000000010000010000000000000010111000000000000100000010000000001000111100000000000000010100001100000000000000000000000000
000000000000000000000000000100000000000000000000000000000000001111000000000000000000100000000000000000000000000000000000
000000000010000000000100000000000000000000000000000000000000111000000000000000000000000000000000000000000000000000000000
000000000000000001110010000000000000000000000000000000001110000000000000000000000000000000000000000000000000000000000000
000000000100001100000010000000000000000000000000000001100000000000000000000000000000000000000000000000000000000000000000
000000000111000000000000000000000000000000000000011100000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000001000000000000000000000011000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000001000000000000000000111000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000100000000000001110000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000100000000011110000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000010000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000010000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000100000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000011000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000010000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000001100000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000110000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000110000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000001100000000110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000011111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000