📄 testhlv11.lst
字号:
244 2 dis_grn7=0;
245 2 dis_blu7=0;
246 2
247 2 /*
248 2
249 2 for(j=0;j<7;j++)
250 2 {
251 2 dis_red0=x7cr[j];
252 2 dis_red1=x7cr[j+1];
253 2 dis_red2=x7cr[j+2];
254 2 dis_red3=x7cr[j+3];
255 2 dis_red4=x7cr[j+4];
256 2 dis_red5=x7cr[j+5];
257 2 dis_red6=x7cr[j+6];
258 2 dis_red7=x7cr[j+7];
259 2
260 2
261 2 dis_grn0=x7cg[j];
262 2 dis_grn1=x7cg[j+1];
263 2 dis_grn2=x7cg[j+2];
264 2 dis_grn3=x7cg[j+3];
265 2 dis_grn4=x7cg[j+4];
266 2 dis_grn5=x7cg[j+5];
267 2 dis_grn6=x7cg[j+6];
268 2 dis_grn7=x7cg[j+7];
269 2
270 2
271 2 dis_blu0=x7cb[j];
272 2 dis_blu1=x7cb[j+1];
273 2 dis_blu2=x7cb[j+2];
274 2 dis_blu3=x7cb[j+3];
275 2 dis_blu4=x7cb[j+4];
276 2 dis_blu5=x7cb[j+5];
277 2 dis_blu6=x7cb[j+6];
278 2 dis_blu7=x7cb[j+7];
279 2
280 2 delay(speed);
281 2 }
282 2 for(j=0;j<3;j++)
283 2 {
284 2 dis_red0=x7cr[j];
285 2 dis_red1=x7cr[j+1];
286 2 dis_red2=x7cr[j+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
292 2 dis_blu0=0;
293 2 dis_blu1=0;
294 2 dis_blu2=0;
295 2 */
296 2 delay(speed);
297 2
298 2 }
299 1 }
300 //********************************
301 // 多彩流动
302 //***************************************
C51 COMPILER V7.06 TESTHLV11 08/02/2004 16:26:51 PAGE 6
303 void qcld(uint speed,uchar step)
304 {
305 1 uchar j;
306 1 for(j=0;j<255;j+=step)
307 1 {
308 2 dis_red0=x64cr[j];
309 2 dis_red1=x64cr[j+1];
310 2 dis_red2=x64cr[j+2];
311 2 dis_red3=x64cr[j+3];
312 2 dis_red4=x64cr[j+4];
313 2 dis_red5=x64cr[j+5];
314 2 dis_red6=x64cr[j+6];
315 2 dis_red7=x64cr[j+7];
316 2
317 2
318 2 dis_grn0=x64cg[j];
319 2 dis_grn1=x64cg[j+1];
320 2 dis_grn2=x64cg[j+2];
321 2 dis_grn3=x64cg[j+3];
322 2 dis_grn4=x64cg[j+4];
323 2 dis_grn5=x64cg[j+5];
324 2 dis_grn6=x64cg[j+6];
325 2 dis_grn7=x64cg[j+7];
326 2
327 2
328 2 dis_blu0=x64cb[j];
329 2 dis_blu1=x64cb[j+1];
330 2 dis_blu2=x64cb[j+2];
331 2 dis_blu3=x64cb[j+3];
332 2 dis_blu4=x64cb[j+4];
333 2 dis_blu5=x64cb[j+5];
334 2 dis_blu6=x64cb[j+6];
335 2 dis_blu7=x64cb[j+7];
336 2
337 2 delay(speed);
338 2 //while(1);
339 2 }
340 1 }
341 //************************************
342 //七彩过渡
343 //**********************************
344
345 void qcgd(uint speed)
346 {
347 1 uchar i;
348 1 dis_red0=dis_red1=dis_red2=dis_red3=dis_red4=dis_red5=dis_red6=dis_red7=0;
349 1 dis_grn0=dis_grn1=dis_grn2=dis_grn3=dis_grn4=dis_grn5=dis_grn6=dis_red7=0;
350 1 dis_blu0=dis_blu1=dis_blu2=dis_blu3=dis_blu4=dis_blu5=dis_blu6=dis_blu7=0;
351 1 for(i=1;i<16;i++)
352 1 {dis_red0=dis_red1=dis_red2=dis_red3=dis_red4=dis_red5=dis_red6=dis_red7=i;
353 2 delay(speed);
354 2 }
355 1 for(i=1;i<16;i++)
356 1 {//dis_red0=dis_red1=dis_red2=dis_red3=i;
357 2 dis_grn0=dis_grn1=dis_grn2=dis_grn3=dis_grn4=dis_grn5=dis_grn6=dis_red7=i; //yello
358 2 delay(speed);
359 2 }
360 1 for(i=15;i<255;i--)
361 1 {dis_red0=dis_red1=dis_red2=dis_red3=dis_red4=dis_red5=dis_red6=dis_red7=i;
362 2 delay(speed);
363 2 }
364 1 for(i=1;i<16;i++)
C51 COMPILER V7.06 TESTHLV11 08/02/2004 16:26:51 PAGE 7
365 1 {//dis_red0=dis_red1=dis_red2=dis_red3=i;
366 2 dis_blu0=dis_blu1=dis_blu2=dis_blu3=dis_blu4=dis_blu5=dis_blu6=dis_blu7=i;
367 2 delay(speed);
368 2 }
369 1 for(i=15;i<255;i--)
370 1 {//dis_red0=dis_red1=dis_red2=dis_red3=i; //blue
371 2 dis_grn0=dis_grn1=dis_grn2=dis_grn3=dis_grn4=dis_grn5=dis_grn6=dis_red7=i; //yello
372 2 delay(speed);
373 2 }
374 1 for(i=1;i<16;i++)
375 1 {dis_red0=dis_red1=dis_red2=dis_red3=dis_red4=dis_red5=dis_red6=dis_red7=i;
376 2 delay(speed);
377 2 }
378 1 for(i=15;i<255;i--)
379 1 {dis_grn0=dis_grn1=dis_grn2=dis_grn3=dis_grn4=dis_grn5=dis_grn6=dis_red7=i; //yello
380 2 delay(speed);
381 2 }
382 1 }
383
384 //*****************************************
385 //*********************************
386 void main(void)
387 {
388 1
389 1 TMOD=0x01;
390 1 TL0=V_TL0;
391 1 TH0=V_TH0;
392 1 TR0=1;
393 1 ET0=1;
394 1 TR1=1;
395 1 EA=1;
396 1 rl=0x01;
397 1 SCON=0;
398 1 ES=0;
399 1 reg02=0x4f;
400 1 P1=0;
401 1 while(1)
402 1 {
403 2 qczz(500);
404 2 qcgd(100);
405 2 qcld(40,1);
406 2
407 2 }
408 1 }
409
410 //**************************************
411 void pwmout(void)
412 {
413 1 red0=(bit)(dis_red0&rl);
414 1 red1=(bit)(dis_red1&rl);
415 1 red2=(bit)(dis_red2&rl);
416 1 red3=(bit)(dis_red3&rl);
417 1 red4=(bit)(dis_red4&rl);
418 1 red5=(bit)(dis_red5&rl);
419 1 red6=(bit)(dis_red6&rl);
420 1 red7=(bit)(dis_red7&rl);
421 1
422 1
423 1 grn0=(bit)(dis_grn0&rl);
424 1 grn1=(bit)(dis_grn1&rl);
425 1 grn2=(bit)(dis_grn2&rl);
426 1 grn3=(bit)(dis_grn3&rl);
C51 COMPILER V7.06 TESTHLV11 08/02/2004 16:26:51 PAGE 8
427 1 grn4=(bit)(dis_grn4&rl);
428 1 grn5=(bit)(dis_grn5&rl);
429 1 grn6=(bit)(dis_grn6&rl);
430 1 grn7=(bit)(dis_grn7&rl);
431 1
432 1
433 1 blu0=(bit)(dis_blu0&rl);
434 1 blu1=(bit)(dis_blu1&rl);
435 1 blu2=(bit)(dis_blu2&rl);
436 1 blu3=(bit)(dis_blu3&rl);
437 1 blu4=(bit)(dis_blu4&rl);
438 1 blu5=(bit)(dis_blu5&rl);
439 1 blu6=(bit)(dis_blu6&rl);
440 1 blu7=(bit)(dis_blu7&rl);
441 1
442 1
443 1 SBUF=sfd2;while(!TI);TI=0;
444 1 SBUF=sfd1;while(!TI);TI=0;
445 1 SBUF=sfd0;while(!TI);TI=0;
446 1 lat=1;
447 1 lat=0;
448 1 }
449
450 //*******************************************
451 void timer1() interrupt 1
452 {//TR0=0;
453 1 pwm++;
454 1 switch(pwm)
455 1 {
456 2 case 1:
457 2 pwmout();
458 2 rl=0x02;
459 2 break;
460 2 case 2:
461 2 pwmout();
462 2 rl=0x04;
463 2 break;
464 2 case 4:
465 2 pwmout();
466 2 rl=0x08;
467 2 break;
468 2 case 8:
469 2 pwmout();
470 2 rl=0x01;
471 2 break;
472 2 case 16:
473 2 pwm=0;
474 2 break;
475 2 default: break;
476 2 }
477 1 TL0=V_TL0;
478 1 TH0=V_TH0;
479 1 //TR0=1;
480 1 }//end sub
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 904 ----
CONSTANT SIZE = 756 ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
DATA SIZE = 32 2
C51 COMPILER V7.06 TESTHLV11 08/02/2004 16:26:51 PAGE 9
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 + -