📄 testhl.lst
字号:
260 2 dis_blu4=dis_blu5;
261 2
262 2 dis_red5=dis_red6;
263 2 dis_grn5=dis_grn6;
264 2 dis_blu5=dis_blu6;
265 2
266 2 dis_red6=dis_red7;
267 2 dis_grn6=dis_grn7;
268 2 dis_blu6=dis_blu7;
269 2
270 2 dis_red7=0;
271 2 dis_grn7=0;
272 2 dis_blu7=0;
273 2
274 2 /*
275 2
276 2 for(j=0;j<7;j++)
277 2 {
278 2 dis_red0=x7cr[j];
279 2 dis_red1=x7cr[j+1];
280 2 dis_red2=x7cr[j+2];
281 2 dis_red3=x7cr[j+3];
282 2 dis_red4=x7cr[j+4];
283 2 dis_red5=x7cr[j+5];
284 2 dis_red6=x7cr[j+6];
285 2 dis_red7=x7cr[j+7];
286 2
287 2
288 2 dis_grn0=x7cg[j];
289 2 dis_grn1=x7cg[j+1];
290 2 dis_grn2=x7cg[j+2];
291 2 dis_grn3=x7cg[j+3];
292 2 dis_grn4=x7cg[j+4];
293 2 dis_grn5=x7cg[j+5];
294 2 dis_grn6=x7cg[j+6];
295 2 dis_grn7=x7cg[j+7];
296 2
297 2
298 2 dis_blu0=x7cb[j];
299 2 dis_blu1=x7cb[j+1];
300 2 dis_blu2=x7cb[j+2];
301 2 dis_blu3=x7cb[j+3];
302 2 dis_blu4=x7cb[j+4];
C51 COMPILER V7.06 TESTHL 07/17/2004 16:43:15 PAGE 6
303 2 dis_blu5=x7cb[j+5];
304 2 dis_blu6=x7cb[j+6];
305 2 dis_blu7=x7cb[j+7];
306 2
307 2 delay(speed);
308 2 }
309 2 for(j=0;j<3;j++)
310 2 {
311 2 dis_red0=x7cr[j];
312 2 dis_red1=x7cr[j+1];
313 2 dis_red2=x7cr[j+2];
314 2
315 2 dis_grn0=x7cg[j];
316 2 dis_grn1=x7cg[j+1];
317 2 dis_grn2=x7cg[j+2];
318 2
319 2 dis_blu0=0;
320 2 dis_blu1=0;
321 2 dis_blu2=0;
322 2 */
323 2 delay(speed);
324 2
325 2 }
326 1 }
327 //********************************
328 // 多彩流动
329 //***************************************
330 void qcld(uint speed,uchar step)
331 {
332 1 uchar j;
333 1 for(j=0;j<255;j+=step)
334 1 {
335 2 dis_red0=x64cr[j];
336 2 dis_red1=x64cr[j+1];
337 2 dis_red2=x64cr[j+2];
338 2 dis_red3=x64cr[j+3];
339 2 dis_red4=x64cr[j+4];
340 2 dis_red5=x64cr[j+5];
341 2 dis_red6=x64cr[j+6];
342 2 dis_red7=x64cr[j+7];
343 2
344 2
345 2 dis_grn0=x64cg[j];
346 2 dis_grn1=x64cg[j+1];
347 2 dis_grn2=x64cg[j+2];
348 2 dis_grn3=x64cg[j+3];
349 2 dis_grn4=x64cg[j+4];
350 2 dis_grn5=x64cg[j+5];
351 2 dis_grn6=x64cg[j+6];
352 2 dis_grn7=x64cg[j+7];
353 2
354 2
355 2 dis_blu0=x64cb[j];
356 2 dis_blu1=x64cb[j+1];
357 2 dis_blu2=x64cb[j+2];
358 2 dis_blu3=x64cb[j+3];
359 2 dis_blu4=x64cb[j+4];
360 2 dis_blu5=x64cb[j+5];
361 2 dis_blu6=x64cb[j+6];
362 2 dis_blu7=x64cb[j+7];
363 2
364 2 delay(speed);
C51 COMPILER V7.06 TESTHL 07/17/2004 16:43:15 PAGE 7
365 2 //while(1);
366 2 }
367 1 }
368 //************************************
369 //七彩过渡
370 //**********************************
371
372 void qcgd(uint speed)
373 {
374 1 uchar i;
375 1 dis_red0=dis_red1=dis_red2=dis_red3=dis_red4=dis_red5=dis_red6=dis_red7=0;
376 1 dis_grn0=dis_grn1=dis_grn2=dis_grn3=dis_grn4=dis_grn5=dis_grn6=dis_red7=0;
377 1 dis_blu0=dis_blu1=dis_blu2=dis_blu3=dis_blu4=dis_blu5=dis_blu6=dis_blu7=0;
378 1 for(i=1;i<16;i++)
379 1 {dis_red0=dis_red1=dis_red2=dis_red3=dis_red4=dis_red5=dis_red6=dis_red7=i;
380 2 delay(speed);
381 2 }
382 1 for(i=1;i<16;i++)
383 1 {//dis_red0=dis_red1=dis_red2=dis_red3=i;
384 2 dis_grn0=dis_grn1=dis_grn2=dis_grn3=dis_grn4=dis_grn5=dis_grn6=dis_red7=i; //yello
385 2 delay(speed);
386 2 }
387 1 for(i=15;i<255;i--)
388 1 {dis_red0=dis_red1=dis_red2=dis_red3=dis_red4=dis_red5=dis_red6=dis_red7=i;
389 2 delay(speed);
390 2 }
391 1 for(i=1;i<16;i++)
392 1 {//dis_red0=dis_red1=dis_red2=dis_red3=i;
393 2 dis_blu0=dis_blu1=dis_blu2=dis_blu3=dis_blu4=dis_blu5=dis_blu6=dis_blu7=i;
394 2 delay(speed);
395 2 }
396 1 for(i=15;i<255;i--)
397 1 {//dis_red0=dis_red1=dis_red2=dis_red3=i; //blue
398 2 dis_grn0=dis_grn1=dis_grn2=dis_grn3=dis_grn4=dis_grn5=dis_grn6=dis_red7=i; //yello
399 2 delay(speed);
400 2 }
401 1 for(i=1;i<16;i++)
402 1 {dis_red0=dis_red1=dis_red2=dis_red3=dis_red4=dis_red5=dis_red6=dis_red7=i;
403 2 delay(speed);
404 2 }
405 1 for(i=15;i<255;i--)
406 1 {dis_grn0=dis_grn1=dis_grn2=dis_grn3=dis_grn4=dis_grn5=dis_grn6=dis_red7=i; //yello
407 2 delay(speed);
408 2 }
409 1 }
410
411 //*****************************************
412 //*********************************
413 void main(void)
414 {
415 1
416 1 TMOD=0x01;
417 1 TL0=V_TL0;
418 1 TH0=V_TH0;
419 1 TR0=1;
420 1 ET0=1;
421 1 TR1=1;
422 1 EA=1;
423 1 rl=0x01;
424 1 SCON=0;
425 1 ES=0;
426 1 reg02=0x4f;
C51 COMPILER V7.06 TESTHL 07/17/2004 16:43:15 PAGE 8
427 1 P1=0;
428 1 while(1)
429 1 {
430 2 //qczz(500);
431 2 //qcgd(100);
432 2 qcld(40,1);
433 2
434 2 }
435 1 }
436
437 //**************************************
438 void pwmout(void)
439 {
440 1 red0=(bit)(dis_red0&rl);
441 1 red1=(bit)(dis_red1&rl);
442 1 red2=(bit)(dis_red2&rl);
443 1 red3=(bit)(dis_red3&rl);
444 1 red4=(bit)(dis_red4&rl);
445 1 red5=(bit)(dis_red5&rl);
446 1 red6=(bit)(dis_red6&rl);
447 1 red7=(bit)(dis_red7&rl);
448 1
449 1
450 1 grn0=(bit)(dis_grn0&rl);
451 1 grn1=(bit)(dis_grn1&rl);
452 1 grn2=(bit)(dis_grn2&rl);
453 1 grn3=(bit)(dis_grn3&rl);
454 1 grn4=(bit)(dis_grn4&rl);
455 1 grn5=(bit)(dis_grn5&rl);
456 1 grn6=(bit)(dis_grn6&rl);
457 1 grn7=(bit)(dis_grn7&rl);
458 1
459 1
460 1 blu0=(bit)(dis_blu0&rl);
461 1 blu1=(bit)(dis_blu1&rl);
462 1 blu2=(bit)(dis_blu2&rl);
463 1 blu3=(bit)(dis_blu3&rl);
464 1 blu4=(bit)(dis_blu4&rl);
465 1 blu5=(bit)(dis_blu5&rl);
466 1 blu6=(bit)(dis_blu6&rl);
467 1 blu7=(bit)(dis_blu7&rl);
468 1
469 1
470 1 reg01=sfd2;
471 1 reg01=sfd1;
472 1 reg01=sfd0;
473 1 lat=1;
474 1 lat=0;
475 1 }
476
477 //*******************************************
478 void timer1() interrupt 1
479 {//TR0=0;
480 1 pwm++;
481 1 switch(pwm)
482 1 {
483 2 case 1:
484 2 pwmout();
485 2 rl=0x02;
486 2 break;
487 2 case 2:
488 2 pwmout();
C51 COMPILER V7.06 TESTHL 07/17/2004 16:43:15 PAGE 9
489 2 rl=0x04;
490 2 break;
491 2 case 4:
492 2 pwmout();
493 2 rl=0x08;
494 2 break;
495 2 case 8:
496 2 pwmout();
497 2 rl=0x01;
498 2 // pwm=0;
499 2 break;
500 2 case 16:
501 2 // pwmout();
502 2 // rl=0x01;
503 2 pwm=0;
504 2 break;
505 2 // case 31:
506 2 // pwm=0;
507 2 // break;
508 2 default: break;
509 2 }
510 1 TL0=V_TL0;
511 1 TH0=V_TH0;
512 1 //TR0=1;
513 1 }//end sub
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 886 ----
CONSTANT SIZE = 756 ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
DATA SIZE = 32 2
IDATA SIZE = ---- ----
BIT SIZE = ---- ----
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -