Advertisement
Guest User

Untitled

a guest
Aug 25th, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.84 KB | None | 0 0
  1. // vector de las filas
  2. const int row[8] = {
  3.  
  4. 2, 7, 19, 5, 13, 18, 12, 16
  5. //este orden se debe al modelo de matriz
  6. };
  7.  
  8. // vector de las columnas
  9. const int col[8] = {
  10. 6, 11, 10, 3, 17, 4, 8, 9
  11. //este orden se debe al modelo de matriz
  12. };
  13.  
  14. // matriz de pixeles
  15. int pixels[8][8];
  16.  
  17. // posicion del cursor
  18. int x = 5;
  19. int y = 5;
  20.  
  21. //Para el serial
  22. String palabra="9";
  23. int l=palabra.length();
  24.  
  25.  
  26. //**********************************************************************//
  27. //--------------------DEFINICION DE LOS NUMEROS-------------------------//
  28. //**********************************************************************//
  29. int cero[8][8]=
  30. {
  31. { 1, 1, 0, 0, 0, 0, 1, 1},
  32. { 1, 0, 0, 1, 1, 0 ,0, 1},
  33. { 1, 0, 0, 1, 0, 0 ,0, 1},
  34. { 1, 0 ,0, 0, 0, 0, 0, 1},
  35. { 1, 0 ,0, 0, 1, 0 ,0, 1},
  36. { 1, 0, 0, 1, 1, 0, 0, 1},
  37. { 1, 1, 0, 0, 0, 0, 1, 1},
  38. { 1 ,1, 1, 1, 1, 1, 1, 1}
  39. };
  40.  
  41.  
  42.  
  43. int uno[8][8]=
  44. {
  45. { 1, 1, 1, 0, 0, 1, 1, 1},
  46. { 1, 1, 0, 0, 0, 1 ,1, 1},
  47. { 1, 0, 0, 0, 0, 1 ,1, 1},
  48. { 1, 1 ,1, 0, 0, 1, 1, 1},
  49. { 1, 1 ,1, 0, 0, 1 ,1, 1},
  50. { 1, 1, 1, 0, 0, 1, 1, 1},
  51. { 1, 0, 0, 0, 0, 0, 0, 1},
  52. { 1 ,1, 1, 1, 1, 1, 1, 1}
  53. };
  54.  
  55.  
  56.  
  57. int dos[8][8]=
  58. {
  59. { 1, 1, 0, 0, 0, 0, 1, 1},
  60. { 1, 0, 0, 1, 1, 0 ,0, 1},
  61. { 1, 1, 1, 1, 1, 0 ,0, 1},
  62. { 1, 1 ,1, 0, 0, 0, 1, 1},
  63. { 1, 1 ,0, 0, 1, 1 ,1, 1},
  64. { 1, 0, 0, 1, 1, 1, 1, 1},
  65. { 1, 0, 0, 0, 0, 0, 0, 1},
  66. { 1 ,1, 1, 1, 1, 1, 1, 1}
  67. };
  68.  
  69.  
  70.  
  71. int tres[8][8]=
  72. {
  73. { 1, 1, 0, 0, 0, 0, 1, 1},
  74. { 1, 0, 0, 1, 1, 0, 0, 1},
  75. { 1, 1, 1, 1, 1, 0, 0, 1},
  76. { 1, 1 ,1, 0, 0, 0, 1, 1},
  77. { 1, 1 ,1, 1, 1, 0, 0, 1},
  78. { 1, 0, 0, 1, 1, 0, 0, 1},
  79. { 1, 1, 0, 0, 0, 0, 1, 1},
  80. { 1 ,1, 1, 1, 1, 1, 1, 1}
  81. };
  82.  
  83.  
  84.  
  85. int cuatro[8][8]=
  86. {
  87. {1, 1, 1, 1, 0, 0, 1, 1},
  88. {1, 1, 1, 0, 0, 0, 1, 1},
  89. {1, 1, 0, 0, 0, 0, 1, 1},
  90. {1, 0, 0 ,1, 0, 0, 1, 1},
  91. {1, 0, 0 ,0, 0, 0, 0, 1},
  92. {1, 1, 1, 1, 0, 0, 1, 1},
  93. {1, 1, 1, 1, 0, 0, 1, 1},
  94. {1, 1 ,1, 1, 1, 1, 1, 1}
  95. };
  96.  
  97.  
  98. int cinco[8][8]=
  99. {
  100. { 1, 0, 0, 0, 0, 0, 0, 1},
  101. { 1, 0, 0, 1, 1, 1 ,1, 1},
  102. { 1, 0, 0, 0, 0, 0 ,1, 1},
  103. { 1, 1, 1, 1, 1, 0, 0, 1},
  104. { 1, 1, 1, 1, 1, 0 ,0, 1},
  105. { 1, 0, 0, 1, 1, 0, 0, 1},
  106. { 1, 1, 0, 0, 0, 0, 1, 1},
  107. { 1 ,1, 1, 1, 1, 1, 1, 1}
  108. };
  109.  
  110.  
  111.  
  112. int seis[8][8]=
  113. {
  114. { 1, 1, 1, 0, 0, 0, 1, 1},
  115. { 1, 1, 0, 0, 1, 1 ,1, 1},
  116. { 1, 0, 0, 1, 1, 1 ,1, 1},
  117. { 1, 0 ,0, 0, 0, 0, 1, 1},
  118. { 1, 0 ,0, 1, 1, 0 ,0, 1},
  119. { 1, 0, 0, 1, 1, 0, 0, 1},
  120. { 1, 1, 0, 0, 0, 0, 1, 1},
  121. { 1 ,1, 1, 1, 1, 1, 1, 1}
  122. };
  123.  
  124.  
  125. int siete[8][8] =
  126. {
  127. {1, 0, 0, 0, 0, 0, 0, 1},
  128. {1, 1, 1, 1, 1, 0, 0, 1},
  129. {1, 1, 1, 1, 0, 0, 1, 1},
  130. {1, 1, 1, 0, 0, 1, 1, 1},
  131. {1, 1, 0, 0, 1, 1, 1, 1},
  132. {1, 1, 0, 0, 1, 1, 1, 1},
  133. {1, 1, 0, 0, 1, 1, 1, 1},
  134. {1, 1, 1, 1, 1, 1, 1, 1}
  135. };
  136.  
  137. int ocho[8][8] =
  138. {
  139. {1, 1, 0, 0, 0, 0, 1, 1},
  140. {1, 0, 0, 1, 1, 0, 0, 1},
  141. {1, 0, 0, 1, 1, 0, 0, 1},
  142. {1, 1, 0, 0, 0, 0, 1, 1},
  143. {1, 0, 0, 1, 1, 0, 0, 1},
  144. {1, 0, 0, 1, 1, 0, 0, 1},
  145. {1, 1, 0, 0, 0, 0, 1, 1},
  146. {1, 1, 1, 1, 1, 1, 1, 1}
  147. };
  148.  
  149. int nueve[8][8] =
  150. {
  151. {1, 1, 0, 0, 0, 0, 1, 1},
  152. {1, 0, 0, 1, 1, 0, 0, 1},
  153. {1, 0, 0, 1, 1, 0, 0, 1},
  154. {1, 1, 0, 0, 0, 0, 0, 1},
  155. {1, 1, 1, 1, 1, 0, 0, 1},
  156. {1, 1, 1, 1, 0, 0, 1, 1},
  157. {1, 1, 0, 0, 0, 1, 1, 1},
  158. {1, 1, 1, 1, 1, 1, 1, 1}
  159. };
  160. //**********************************************************************//
  161.  
  162.  
  163.  
  164. //**********************************************************************//
  165. //--------------------DEFINICION DE LAS LETRAS--------------------------//
  166. //**********************************************************************//
  167.  
  168. //int A[8][8]=
  169. //{
  170. // {1, 1, 0, 0, 0, 0, 1, 1},
  171. // {1, 0, 0, 1, 1, 0, 0, 1},
  172. // {1, 0, 0, 1, 1, 0, 0, 1},
  173. // {1, 0, 0, 1, 1, 0, 0, 1},
  174. // {1, 0, 0, 0, 0, 0, 0, 1},
  175. // {1, 0, 0, 1, 1, 0, 0, 1},
  176. // {1, 0, 0, 1, 1, 0, 0, 1},
  177. // {1, 1, 1, 1, 1, 1, 1, 1}
  178. //};
  179. //
  180. //int B[8][8]=
  181. //{
  182. // {1, 0, 0, 0, 0, 0, 1, 1},
  183. // {1, 0, 0, 1, 1, 0, 0, 1},
  184. // {1, 0, 0, 1, 1, 0, 0, 1},
  185. // {1, 0, 0, 0, 0, 0, 1, 1},
  186. // {1, 0, 0, 1, 1, 0, 0, 1},
  187. // {1, 0, 0, 1, 1, 0, 0, 1},
  188. // {1, 0, 0, 0, 0, 0, 1, 1},
  189. // {1, 1, 1, 1, 1, 1, 1, 1}
  190. //};
  191. //
  192. //int C[8][8]=
  193. //{
  194. // {1, 1, 0, 0, 0, 0, 1, 1},
  195. // {1, 0, 0, 1, 1, 0, 0, 1},
  196. // {1, 0, 0, 1, 1, 1, 1, 1},
  197. // {1, 0, 0, 1, 1, 1, 1, 1},
  198. // {1, 0, 0, 1, 1, 1, 1, 1},
  199. // {1, 0, 0, 1, 1, 0, 0, 1},
  200. // {1, 1, 0, 0, 0, 0, 1, 1},
  201. // {1, 1, 1, 1, 1, 1, 1, 1}
  202. //};
  203. //int D[8][8]=
  204. //{
  205. // {1, 0, 0, 0, 0, 1, 1, 1},
  206. // {1, 0, 0, 1, 0, 0, 1, 1},
  207. // {1, 0, 0, 1, 1, 0, 0, 1},
  208. // {1, 0, 0, 1, 1, 0, 0, 1},
  209. // {1, 0, 0, 1, 1, 0, 0, 1},
  210. // {1, 0, 0, 1, 0, 0, 1, 1},
  211. // {1, 0, 0, 0, 0, 1, 1, 1},
  212. // {1, 1, 1, 1, 1, 1, 1, 1}
  213. //};
  214. //
  215. //int E[8][8]=
  216. //{
  217. // {1, 0, 0, 0, 0, 0, 0, 1},
  218. // {1, 0, 0, 1, 1, 1, 1, 1},
  219. // {1, 0, 0, 1, 1, 1, 1, 1},
  220. // {1, 0, 0, 0, 0, 0, 1, 1},
  221. // {1, 0, 0, 1, 1, 1, 1, 1},
  222. // {1, 0, 0, 1, 1, 1, 1, 1},
  223. // {1, 0, 0, 0, 0, 0, 0, 1},
  224. // {1, 1, 1, 1, 1, 1, 1, 1}
  225. //};
  226. //
  227. //int F[8][8]=
  228. //{
  229. // {1, 0, 0, 0, 0, 0, 0, 1},
  230. // {1, 0, 0, 1, 1, 1, 1, 1},
  231. // {1, 0, 0, 1, 1, 1, 1, 1},
  232. // {1, 0, 0, 0, 0, 0, 1, 1},
  233. // {1, 0, 0, 1, 1, 1, 1, 1},
  234. // {1, 0, 0, 1, 1, 1, 1, 1},
  235. // {1, 0, 0, 1, 1, 1, 1, 1},
  236. // {1, 1, 1, 1, 1, 1, 1, 1}
  237. //};
  238. //
  239. //int G[8][8]=
  240. //{
  241. // {1, 1, 0, 0, 0, 0, 1, 1},
  242. // {1, 0, 0, 1, 1, 0, 0, 1},
  243. // {1, 0, 0, 1, 1, 1, 1, 1},
  244. // {1, 0, 0, 0, 0, 0, 0, 1},
  245. // {1, 0, 0, 1, 1, 0, 0, 1},
  246. // {1, 0, 0, 1, 1, 0, 0, 1},
  247. // {1, 1, 0, 0, 0, 0, 0, 1},
  248. // {1, 1, 1, 1, 1, 1, 1, 1}
  249. //};
  250. //
  251. //int H[8][8]=
  252. //{
  253. // {1, 0, 0, 1, 1, 0, 0, 1},
  254. // {1, 0, 0, 1, 1, 0, 0, 1},
  255. // {1, 0, 0, 1, 1, 0, 0, 1},
  256. // {1, 0, 0, 0, 0, 0, 0, 1},
  257. // {1, 0, 0, 1, 1, 0, 0, 1},
  258. // {1, 0, 0, 1, 1, 0, 0, 1},
  259. // {1, 0, 0, 1, 1, 0, 0, 1},
  260. // {1, 1, 1, 1, 1, 1, 1, 1}
  261. //};
  262. //
  263. //int I[8][8]=
  264. //{
  265. // {1, 1, 0, 0, 0, 0, 1, 1},
  266. // {1, 1, 1, 0, 0, 1, 1, 1},
  267. // {1, 1, 1, 0, 0, 1, 1, 1},
  268. // {1, 1, 1, 0, 0, 1, 1, 1},
  269. // {1, 1, 1, 0, 0, 1, 1, 1},
  270. // {1, 1, 1, 0, 0, 1, 1, 1},
  271. // {1, 1, 0, 0, 0, 0, 1, 1},
  272. // {1, 1, 1, 1, 1, 1, 1, 1}
  273. //};
  274. //
  275. //int J[8][8]=
  276. //{
  277. // {1, 1, 1, 0, 0, 0, 0, 1},
  278. // {1, 1, 1, 1, 0, 0, 1, 1},
  279. // {1, 1, 1, 1, 0, 0, 1, 1},
  280. // {1, 1, 1, 1, 0, 0, 1, 1},
  281. // {1, 0, 0, 1, 0, 0, 1, 1},
  282. // {1, 0, 0, 1, 0, 0, 1, 1},
  283. // {1, 1, 0, 0, 0, 1, 1, 1},
  284. // {1, 1, 1, 1, 1, 1, 1, 1}
  285. //};
  286. //
  287. //int K[8][8]=
  288. //{
  289. // {1, 0, 0, 1, 1, 0, 0, 1},
  290. // {1, 0, 0, 1, 0, 0, 1, 1},
  291. // {1, 0, 0, 0, 0, 1, 1, 1},
  292. // {1, 0, 0, 0, 1, 1, 1, 1},
  293. // {1, 0, 0, 0, 0, 1, 1, 1},
  294. // {1, 0, 0, 1, 0, 0, 1, 1},
  295. // {1, 0, 0, 1, 1, 0, 0, 1},
  296. // {1, 0, 0, 1, 1, 1, 1, 1}
  297. //};
  298. //
  299. //int L[8][8]=
  300. //{
  301. // {1, 0, 0, 1, 1, 1, 1, 1},
  302. // {1, 0, 0, 1, 1, 1, 1, 1},
  303. // {1, 0, 0, 1, 1, 1, 1, 1},
  304. // {1, 0, 0, 1, 1, 1, 1, 1},
  305. // {1, 0, 0, 1, 1, 1, 1, 1},
  306. // {1, 0, 0, 1, 1, 1, 1, 1},
  307. // {1, 0, 0, 1, 1, 1, 1, 1},
  308. // {1, 0, 0, 0, 0, 0, 0, 1}
  309. //};
  310. //
  311. //int M[8][8]=
  312. //{
  313. // {1, 0, 0, 1, 0, 0, 0, 1},
  314. // {0, 0, 0, 0, 0, 0, 0, 0},
  315. // {0, 0, 0, 0, 0, 0, 0, 0},
  316. // {0, 0, 1, 0, 0, 1, 0, 0},
  317. // {0, 0, 1, 0, 0, 1, 0, 0},
  318. // {0, 0, 1, 1, 1, 1, 0, 0},
  319. // {0, 0, 1, 1, 1, 1, 0, 0},
  320. // {1, 1, 1, 1, 1, 1, 1, 1}
  321. //};
  322. //
  323. //int N[8][8]=
  324. //{
  325. // {1, 0, 0, 1, 1, 0, 0, 1},
  326. // {1, 0, 0, 1, 1, 0, 0, 1},
  327. // {1, 0, 0, 0, 1, 0, 0, 1},
  328. // {1, 0, 0, 0, 0, 0, 0, 1},
  329. // {1, 0, 0, 1, 0, 0, 0, 1},
  330. // {1, 0, 0, 1, 1, 0, 0, 1},
  331. // {1, 0, 0, 1, 1, 0, 0, 1},
  332. // {1, 1, 1, 1, 1, 1, 1, 1}
  333. //};
  334. //
  335. //int O[8][8]=
  336. //{
  337. // {1, 1, 0, 0, 0, 0, 1, 1},
  338. // {1, 0, 0, 1, 1, 0, 0, 1},
  339. // {1, 0, 0, 1, 1, 0, 0, 1},
  340. // {1, 0, 0, 1, 1, 0, 0, 1},
  341. // {1, 0, 0, 1, 1, 0, 0, 1},
  342. // {1, 0, 0, 1, 1, 0, 0, 1},
  343. // {1, 1, 0, 0, 0, 0, 1, 1},
  344. // {1, 1, 1, 1, 1, 1, 1, 1}
  345. //};
  346. //
  347. //int P[8][8]=
  348. //{
  349. // {1, 0, 0, 0, 0, 0, 1, 1},
  350. // {1, 0, 0, 1, 1, 0, 0, 1},
  351. // {1, 0, 0, 1, 1, 0, 0, 1},
  352. // {1, 0, 0, 0, 0, 0, 1, 1},
  353. // {1, 0, 0, 1, 1, 1, 1, 1},
  354. // {1, 0, 0, 1, 1, 1, 1, 1},
  355. // {1, 0, 0, 1, 1, 1, 1, 1},
  356. // {1, 1, 1, 1, 1, 1, 1, 1}
  357. //};
  358. //
  359. //int Q[8][8]=
  360. //{
  361. // {1, 1, 0, 0, 0, 0, 1, 1},
  362. // {1, 0, 0, 1, 1, 0, 0, 1},
  363. // {1, 0, 0, 1, 1, 0, 0, 1},
  364. // {1, 0, 0, 1, 1, 0, 0, 1},
  365. // {1, 0, 0, 1, 1, 0, 0, 1},
  366. // {1, 0, 0, 0, 0, 0, 0, 1},
  367. // {1, 1, 0, 0, 0, 0, 1, 1},
  368. // {1, 1, 1, 1, 1, 0, 0, 1}
  369. //};
  370. //
  371. int R[8][8]=
  372. {
  373. {1, 0, 0, 0, 0, 0, 1, 1},
  374. {1, 0, 0, 1, 1, 0, 0, 1},
  375. {1, 0, 0, 1, 1, 0, 0, 1},
  376. {1, 0, 0, 0, 0, 0, 1, 1},
  377. {1, 0, 0, 0, 0, 1, 1, 1},
  378. {1, 0, 0, 1, 0, 0, 1, 1},
  379. {1, 0, 0, 1, 1, 0, 0, 1},
  380. {1, 1, 1, 1, 1, 1, 1, 1}
  381. };
  382.  
  383. int S[8][8]=
  384. {
  385. {1, 1, 0, 0, 0, 0, 1, 1},
  386. {1, 0, 0, 1, 1, 0, 0, 1},
  387. {1, 0, 0, 1, 1, 1, 1, 1},
  388. {1, 1, 0, 0, 0, 0, 1, 1},
  389. {1, 1, 1, 1, 1, 0, 0, 1},
  390. {1, 0, 0, 1, 1, 0, 0, 1},
  391. {1, 1, 0, 0, 0, 0, 1, 1},
  392. {1, 1, 1, 1, 1, 1, 1, 1}
  393. };
  394.  
  395.  
  396. intTS[8][8]=
  397. {
  398. {1, 0, 0, 0, 0, 0, 0, 1},
  399. {1, 1, 1, 0, 0, 1, 1, 1},
  400. {1, 1, 1, 0, 0, 1, 1, 1},
  401. {1, 1, 1, 0, 0, 1, 1, 1},
  402. {1, 1, 1, 0, 0, 1, 1, 1},
  403. {1, 1, 1, 0, 0, 1, 1, 1},
  404. {1, 1, 1, 0, 0, 1, 1, 1},
  405. {1, 1, 1, 1, 1, 1, 1, 1}
  406. };
  407.  
  408.  
  409. int U[8][8]=
  410. {
  411. {1, 0, 0, 1, 1, 0, 0, 1},
  412. {1, 0, 0, 1, 1, 0, 0, 1},
  413. {1, 0, 0, 1, 1, 0, 0, 1},
  414. {1, 0, 0, 1, 1, 0, 0, 1},
  415. {1, 0, 0, 1, 1, 0, 0, 1},
  416. {1, 0, 0, 1, 1, 0, 0, 1},
  417. {1, 1, 0, 0, 0, 0, 1, 1},
  418. {1, 1, 1, 1, 1, 1, 1, 1}
  419. };
  420.  
  421.  
  422. int V[8][8]=
  423. {
  424. {1, 0, 0, 1, 1, 0, 0, 1},
  425. {1, 0, 0, 1, 1, 0, 0, 1},
  426. {1, 0, 0, 1, 1, 0, 0, 1},
  427. {1, 0, 0, 1, 1, 0, 0, 1},
  428. {1, 0, 0, 1, 1, 0, 0, 1},
  429. {1, 1, 0, 0, 0, 0, 1, 1},
  430. {1, 1, 1, 0, 0, 1, 1, 1},
  431. {1, 1, 1, 1, 1, 1, 1, 1}
  432. };
  433.  
  434.  
  435. int W[8][8]=
  436. {
  437. {0, 0, 1, 1, 1, 1, 0, 0},
  438. {0, 0, 1, 1, 1, 1, 0, 0},
  439. {0, 0, 1, 1, 1, 1, 0, 0},
  440. {0, 0, 1, 0, 0, 1, 0, 0},
  441. {0, 0, 1, 0, 0, 1, 0, 0},
  442. {0, 0, 0, 0, 0, 0, 0, 0},
  443. {1, 0, 0, 1, 1, 0, 0, 1},
  444. {1, 1, 1, 1, 1, 1, 1, 1}
  445. };
  446. //**********************************************************************//
  447. //-------------------------FUNCION SETUP--------------------------------//
  448. //**********************************************************************//
  449.  
  450. void setup() {
  451.  
  452. Serial.begin(9600);
  453. // Inicializar los PIN como salidas
  454. // Se van iterando los pin
  455. for (int thisPin = 0; thisPin < 8; thisPin++)
  456. {
  457. pinMode(col[thisPin], OUTPUT);
  458. pinMode(row[thisPin], OUTPUT);
  459. // poner los pins de las columnas HIGH para asegurar
  460. //que los LEDS estan apagados
  461. digitalWrite(col[thisPin], HIGH);
  462. }
  463.  
  464. // Inicializar la matriz de pixeles
  465. for (int x = 0; x < 8; x++) {
  466. for (int y = 0; y < 8; y++) {
  467. pixels[x][y] = HIGH;
  468. }
  469. }
  470. }//fin del setup
  471. //**********************************************************************//
  472.  
  473.  
  474. //**********************************************************************//
  475. //--------------------------FUNCION LOOP--------------------------------//
  476. //**********************************************************************//
  477. void loop() {
  478.  
  479. //while(Serial.available()>0)
  480. //{
  481. // for (int m=0; m<30; m++)
  482. // {
  483. // palabra[m]=Serial.read();
  484. // }
  485. //}
  486.  
  487.  
  488.  
  489. for (int n=0; n<l; n++)
  490. {
  491. long t=millis();
  492.  
  493. //char letra = palabra[n];
  494. //Serial.print("antes de numeros");Serial.println(letra);
  495. // Serial.println(palabra[n]);
  496. numeros(palabra[n]);
  497. //Serial.print("despues de numeros");Serial.println(letra);
  498. while(millis()<t+2000)
  499. refreshScreen();
  500. //Serial.print("despues de refreshscreen");//Serial.println(letra);
  501. }
  502.  
  503.  
  504. }// fin del loop
  505. //**********************************************************************//
  506.  
  507.  
  508. //**********************************************************************//
  509. //----------------FUNCION REFRESHSCREEN--------------------------------//
  510. //**********************************************************************//
  511. void refreshScreen() {
  512. //Iterar a traves de las filas
  513. for (int thisRow = 0; thisRow < 8; thisRow++)
  514. {
  515. //Poner el pin de la fila HIGH
  516. digitalWrite(row[thisRow], HIGH);
  517. //Iterar a traves de las columnas
  518. for (int thisCol = 0; thisCol < 8; thisCol++)
  519. {
  520. // obtener el estado del pixel
  521. int thisPixel = pixels[thisRow][thisCol];
  522. // Cuando la fila este HIGH y la columna LOW
  523. //el LED donde se encuentran se enciende
  524. digitalWrite(col[thisCol], thisPixel);
  525. //Apagar el pixel
  526. if (thisPixel == LOW)
  527. {
  528. digitalWrite(col[thisCol], HIGH);
  529. }
  530. }
  531. //Poner el pin de la fila LOW para apagar toda la fila
  532. digitalWrite(row[thisRow], LOW);
  533.  
  534. }
  535. }//fin funcion refreshscreed
  536. //**********************************************************************//
  537.  
  538.  
  539.  
  540.  
  541.  
  542.  
  543. //**********************************************************************//
  544. //----------------------FUNCION LIMPIAR---------------------------------//
  545. //**********************************************************************//
  546. void limpiar()
  547. {
  548. int limpia[8][8]=
  549. {
  550. { 1, 1, 1, 1, 1, 1, 1, 1},
  551. { 1, 1, 1, 1, 1, 1 ,1, 1},
  552. { 1, 1, 1, 1, 1, 1 ,1, 1},
  553. { 1, 1 ,1, 1, 1, 1, 1, 1},
  554. { 1, 1 ,1, 1, 1, 1 ,1, 1},
  555. { 1, 1, 1, 1, 1, 1, 1, 1},
  556. { 1, 1, 1, 1, 1, 1, 1, 1},
  557. { 1 ,1, 1, 1, 1, 1, 1, 1}
  558. };
  559.  
  560. for (int j=0; j<8; j++)
  561. {
  562. for (int i=0; i<8; i++)
  563. {
  564. pixels[i][j]=limpia[i][j];
  565. }
  566. }
  567. }//fin funcion limpiar
  568. //********************************************************************//
  569.  
  570.  
  571. //**********************************************************************//
  572. //---------------------FUNCION NUMEROS--------------------------------//
  573. //**********************************************************************//
  574. void numeros (char z)
  575. {
  576. limpiar();
  577.  
  578. switch (z)
  579. {
  580. case '0':
  581. for (int j=0; j<8; j++)
  582. {
  583. for (int i=0; i<8; i++)
  584. {
  585. pixels[j][i]=cero[j][i];
  586. }
  587. }
  588. break;
  589.  
  590. case '1':
  591. for (int j=0; j<8; j++)
  592. {
  593. for (int i=0; i<8; i++)
  594. {
  595. pixels[j][i]=uno[j][i];
  596. }
  597. }
  598. break;
  599.  
  600. case '2':
  601. for (int j=0; j<8; j++)
  602. {
  603. for (int i=0; i<8; i++)
  604. {
  605. pixels[j][i]=dos[j][i];
  606. }
  607. }
  608. break;
  609.  
  610.  
  611. case '3':
  612. for (int j=0; j<8; j++)
  613. {
  614. for (int i=0; i<8; i++)
  615. {
  616. pixels[j][i]=tres[j][i];
  617. }
  618. }
  619. break;
  620.  
  621. case '4':
  622. for (int j=0; j<8; j++)
  623. {
  624. for (int i=0; i<8; i++)
  625. {
  626. pixels[j][i]=cuatro[j][i];
  627. }
  628. }
  629. break;
  630.  
  631. case '5':
  632. for (int j=0; j<8; j++)
  633. {
  634. for (int i=0; i<8; i++)
  635. {
  636. pixels[j][i]=cinco[j][i];
  637. }
  638. }
  639. break;
  640.  
  641. case '6':
  642. for (int j=0; j<8; j++)
  643. {
  644. for (int i=0; i<8; i++)
  645. {
  646. pixels[j][i]=seis[j][i];
  647. }
  648. }
  649. break;
  650.  
  651. case '7':
  652. for (int j=0; j<8; j++)
  653. {
  654. for (int i=0; i<8; i++)
  655. {
  656. pixels[j][i]=siete[j][i];
  657. }
  658. }
  659. break;
  660.  
  661. case '8':
  662. for (int j=0; j<8; j++)
  663. {
  664. for (int i=0; i<8; i++)
  665. {
  666. pixels[j][i]=ocho[j][i];
  667. }
  668. }
  669. break;
  670.  
  671. case '9':
  672. for (int j=0; j<8; j++)
  673. {
  674. for (int i=0; i<8; i++)
  675. {
  676. pixels[j][i]=nueve[j][i];
  677. }
  678. }
  679. break;
  680.  
  681. case R:
  682. for (int j=0; j<8; j++)
  683. {
  684. for (int i=0; i<8; i++)
  685. {
  686. pixels[j][i]=letraR[j][i];
  687. }
  688. }
  689. break;
  690. }//fin del switch
  691.  
  692.  
  693. }//fin de la funcion numeros
  694. //**********************************************************************//
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement