The Code :
1. #define SPEED 6 //Speed of rolling. The bigger,the slower
2. #define WordNO 12 //number of letters(here one letter on one screen) you want to display + Screen number
3. #define ScreenNO 4 //define the screen number used
4.
5. byte HZ[]={
6. //===== You have to give 32*ScreenNo 0xff bytes as follows,here 4 screens =====
7.
8. 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
9. 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
10. 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
11. 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
12. 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
13. 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
14.
15.
16. //=============================================================================
17.
18.
19. /*0xff,0xff,0x80,0x01,0x80,0x01,0x9f,0xff,0x9f,0xff,0x9f,0xff,0x9f,0xff,0x80,0x03,
20. 0x80,0x03,0x9f,0xff,0x9f,0xff,0x9f,0xff,0x9f,0xff,0x80,0x01,0x80,0x01,0xff,0xff, //"E"
21.
22. 0xff,0xff,0x9f,0xff,0x9f,0xff,0x9f,0xff,0x9f,0xff,0x9f,0xff,0x9f,0xff,0x9f,0xff,
23. 0x9f,0xff,0x9f,0xff,0x9f,0xff,0x9f,0xff,0x9f,0xff,0x80,0x01,0x80,0x01,0xff,0xff,// "L"
24.
25. 0xff,0xff,0x80,0x01,0x80,0x01,0x9f,0xff,0x9f,0xff,0x9f,0xff,0x9f,0xff,0x80,0x03,
26. 0x80,0x03,0x9f,0xff,0x9f,0xff,0x9f,0xff,0x9f,0xff,0x80,0x01,0x80,0x01,0xff,0xff, //"E"
27.
28. 0xff,0xff,0xe0,0x07,0xc0,0x03,0xcf,0xf3,0x9f,0xff,0x9f,0xff,0x9f,0xff,0x9f,0xff,
29. 0x9f,0xff,0x9f,0xff,0x9f,0xff,0x9f,0xff,0xcf,0xf3,0xc0,0x03,0xe0,0x07,0xff,0xff,// "C"
30.
31. 0xff,0xff,0x9f,0xf9,0x9f,0xf9,0x9f,0xf9,0x9f,0xf9,0x9f,0xf9,0x9f,0xf9,0x80,0x01,
32. 0x80,0x01,0x9f,0xf9,0x9f,0xf9,0x9f,0xf9,0x9f,0xf9,0x9f,0xf9,0x9f,0xf9,0xff,0xff,// "H"
33.
34. 0xff,0xff,0xf8,0x1f,0xf0,0x0f,0xe3,0xc7,0xe7,0xe7,0xc7,0xe3,0xcf,0xf3,0xcf,0xf3,
35. 0xcf,0xf3,0xcf,0xf3,0xc7,0xe3,0xe7,0xe7,0xe3,0xc7,0xf0,0x0f,0xf8,0x1f,0xff,0xff,// "O"
36.
37. 0xff,0xff,0x9f,0xf9,0x9f,0xf9,0x9f,0xf9,0x9f,0xf9,0x9f,0xf9,0x9f,0xf9,0x9f,0xf9,
38. 0x9f,0xf9,0x9f,0xf9,0x9f,0xf9,0x9f,0xf9,0x8f,0xf1,0xc0,0x03,0xe0,0x07,0xff,0xff,// "U"
39.
40. 0xff,0xff,0xfc,0x3f,0xf9,0x9f,0xf3,0xcf,0xe7,0xe7,0xe7,0xff,0xf3,0xff,0xf8,0x3f,
41. 0xfc,0x1f,0xff,0xcf,0xff,0xe7,0xe7,0xe7,0xf3,0xcf,0xf9,0x9f,0xfc,0x3f,0xff,0xff,// "S"
42.
43. 0xff,0xff,0x80,0x01,0x80,0x01,0x9f,0xff,0x9f,0xff,0x9f,0xff,0x9f,0xff,0x80,0x03,
44. 0x80,0x03,0x9f,0xff,0x9f,0xff,0x9f,0xff,0x9f,0xff,0x80,0x01,0x80,0x01,0xff,0xff, //"E"
45.
46. 0xff,0xff,0x8f,0xf1,0x87,0xe1,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,0xfe,0x7f,
65. 0xfe,0x7f,0xfe,0x7f,0xfe,0x7f,0xfe,0x7f,0xfe,0x7f,0xfe,0x7f,0xff,0xff,0xff,0xff,//"i"
66.
67. 0xff,0xff,0xff,0xff,0xf8,0x3f,0xf0,0x1f,0xe3,0x8f,0xe7,0xcf,0xe7,0xcf,0xe7,0xcf,
68. 0xe7,0xcf,0xe7,0xcf,0xe7,0xcf,0xe7,0xcf,0xe7,0xc7,0xff,0xff,0xff,0xff,0xff,0xff,//"n"
69.
70. 0xff,0xff,0xff,0xff,0xf8,0x3f,0xf0,0x1f,0xf3,0x9f,0xe7,0xcf,0xe7,0xcf,0xe7,0xcf,
71. 0xe7,0xcf,0xe7,0xcf,0xe7,0xcf,0xf3,0x9f,0xf0,0x1f,0xf8,0x3f,0xff,0xff,0xff,0xff//"o"
72.
73. };
74. byte BUFF[2*ScreenNO+2];
75. byte col,disrow; //col--moving pointer;disrow--scanning row
76. unsigned int wordnumber; //the bytes of words you want to display
77. int Dpin[]={4,5,6,7};
78. int OOE=2;
79. int RCK=10;
80. int SCK=9;
81. int SER=8;
82. int VCC=11;
83. int GND=3;
84.
85. void setup()
86. {
87. pinMode(2,OUTPUT);
88. pinMode(3,OUTPUT);
89. pinMode(4,OUTPUT);
90. pinMode(5,OUTPUT);
91. pinMode(6,OUTPUT);
92. pinMode(7,OUTPUT);
93. pinMode(8,OUTPUT);
94. pinMode(9,OUTPUT);
95. pinMode(10,OUTPUT);
96. pinMode(11,OUTPUT);
97.
98. //Serial.begin(9600);
99. digitalWrite(OOE,HIGH);
100. digitalWrite(VCC,HIGH);
101. digitalWrite(GND,LOW);
102. digitalWrite(SCK,LOW);
103. }
104. void loop()
105. {
106. byte i;
107. col=0;wordnumber=0;
108. while(1)
109. {
110. while(col<16) // circulate for 16 time, which is moving a letter through a creen
111. {
112. for(i=0;i<SPEED;i++) //the time of static display for a letter
113. {
114. for(disrow=0;disrow<16;disrow++) //scanning the row
115. {
116. digitalWrite(OOE,HIGH);
117. digitalWrite(RCK,LOW);
118. loadoneline(); //load the data of a row
119. sendoneline(); //send the data of a row
120. sendPin(disrow);
121. digitalWrite(OOE,LOW); // enable the row scanning
122. digitalWrite(RCK,HIGH); //light a row
123. delay(1);
124. }
125. }
126. col++; //moving pointer
127. }
128. col=0;
129. wordnumber+=32; // point to the next word
130. if(wordnumber>=WordNO*32)wordnumber=0; //while all the letters are dispalyed, back to the beginning
131. }
132. }
133. /***************** load the data of a row *****************/
134. void loadoneline( )
135. {
136. byte s;
137. unsigned int k;
138. for(s=0;s< ScreenNO+1;s++)
139. {
140. k = wordnumber+32*s+2*disrow;
141. if (k>=WordNO*32)k -= WordNO*32;
142. BUFF[2*s]=HZ[k];
143. BUFF[2*s+1]=HZ[k+1];
144. }
145. }
146. /*************** send the data of a row *******************/
147. void sendoneline( )
148. {
149. byte s;
150. byte inc;
151. if(col<8)inc=0;else inc=1;
152. for(s=2*ScreenNO+inc;s>=1+inc;s--)
153. {
154. sendUtra(two_onechar(BUFF[s-1],BUFF[s]));
155. }
156. }
157. /*********** generate data which makes word moving ************/
158. byte two_onechar(byte h1,byte h2)
159. {
160. byte temp,tempcol;
161. if(col<8) tempcol=col;
162. else tempcol=col-8;
163. temp=(h1<<tempcol)|(h2>>(8-tempcol));
164. //temp=255-temp;
165. return temp;
166. }
167. /***************************************************************/
168. void sendPin(byte j)
169. {
170. for (int n=0;n<4;n++)
171. {
172. if((0x01&j) < 0x01)
173. {digitalWrite(Dpin[n],LOW);}
174. else
175. {digitalWrite(Dpin[n],HIGH);}
176. j>>=1;
177. }
178. }
179. /**************************************************************/
180. void sendUtra(byte j)
181. {
182. for (int n=0;n<8;n++)
183. {
184. digitalWrite(SCK,LOW);
185. if((0x01&j) < 0x01)
186. {digitalWrite(SER,LOW);}
187. else
188. {digitalWrite(SER,HIGH);}
189. j=j>>1;
190. digitalWrite(SCK,HIGH);
191. //delay(1);
192.
193. }
194. }