剛好有另外的提問,一并做了個實例,一并回復(fù),我給的連接595驅(qū)動中的十進(jìn)制轉(zhuǎn)化代碼注釋掉,用十六進(jìn)制的代碼替換即可.
- ds=sj>>7;//十六進(jìn)制數(shù)據(jù)發(fā)送
- sj<<=1;
- // ds=sj%2;//十進(jìn)制數(shù)據(jù)發(fā)送
- // sj/=2;
復(fù)制代碼- unsigned char code shuju[]={
- 0x00,0x38,0x44,0x54,0x44,0x38,0x00,0x00,0x00,0x7e,0x7e,0x7e,0x7e,0x7e,0x7e,0x00,0x00,0x00,0x40,0x40,0x40,0x4f,0x70,0x00,
- 0x00,0x00,0x0c,0x14,0x24,0x7f,0x04,0x00,0x00,0x82,0x82,0xFE,0x82,0x82,0x00,0x00,0x18,0x24,0x12,0x12,0x12,0x24,0x18,0x00,
- 0x00,0x7C,0x02,0x02,0x02,0x7C,0x00,0x00
- };//數(shù)據(jù)
- unsigned char code sjwei[]={0x7f,0xbf,0xdf,0xef,0xf7,0xfb,0xfd,0xfe};//位,用移位函數(shù),移位運(yùn)算符,數(shù)字.
- 主函數(shù):
- unsigned char b=0, j=0, xd=0, h=0;
- QuDong595(shuju[b+j]);
- QuDong595(sjwei[b]);
復(fù)制代碼
這是2片級聯(lián)完成的運(yùn)行
|