-
XC8 浮点变量计算问题
#include
#include ............. float xa,xb,xc; void main(void) { xb=0.1; xc=0.1; xa=xb*xc; →这一步仿真无法通过,卡在了浮点变量的计算,哪位大侠给指点一下?谢谢。 ........ } 2216浏览量 3回复量 关注量 -
扎原因扎结果 sos
[b]//代码如下[/b] #include
#include //#include //#include #include #define SEG_BITSEL_PORT PORTD //位选端口 #define SEG_BITSEL_PORT_DIR TRISD //位选端口的方向寄存器 #define SEG_FONT_PORT PORTC //字形输出端口 #define SEG_FONT_PORT_DIR TRISC //字形输出端口的方向寄存器 #define DLY_MS 67 const char Seg7TableN[]={0b11000000,0b11111001,0b10100100,0b10110000,0b10011001,0b10010010,0b10000010,0b11111000,0b10000000,0b10010000}; //__CONFIG(FOSC_HS & WDTE_ON & PWRTE_OFF & BOREN_ON & LVP_ON & CPD_OFF & WRT_OFF & CP_OFF); //__CONFIG (XT & WDTDIS & LVPDIS); unsigned int g_ADRTable[12] = {0,0,0,0,0,0,0,0,0,0,0 }; unsigned char g_Count=0; bit OverFlag = 0;//12位转换次数完成标志位清零; void delayms (int ms); void DisplayData (unsigned int iData); interrupt ISR (void) { if ( ADIE && ADIF ) { ADIF = 0; g_ADRTable[g_Count]=(((unsigned int)ADRESH)<<8)+ADRESL; g_Count++; if(g_Count==12) { g_Count =0; OverFlag=1;// } else { GO_DONE = 1;//启动AD } } else { while(1); } } void main(void) { //void DisplayData(); char i=0,j=0; int tmp = 0;// int adc_v = 0; TRISA0 = 1; SEG_BITSEL_PORT_DIR = 0;//位选端口的方向寄存器,确定输出端口 SEG_FONT_PORT_DIR = 0;//字形输出端口的方向寄存器,确定输出端口 ADFM = 1; PCFG3:PCFG0 = 0000; ADCON0 = 0B11000001; ADIE = 1; ADIF = 0; PEIE = 1; GIE = 1; for(i=0;i<15;i++) { } GO_DONE = 1; while(GO_DONE) { if(OverFlag==1) { for(i=0;i<12;i++)//冒泡法排序 { for(j=i+1;j<12;j++) { if(g_ADRTable[i] > g_ADRTable[j]) { tmp = g_ADRTable[i]; g_ADRTable[i] = g_ADRTable[j]; g_ADRTable[j] = tmp; } } } tmp = 0; for(i=2;i<10;i++) { tmp = tmp + g_ADRTable[i]; } tmp = tmp >>3;//将数按照 2进制像右移动.每向右移动一位,相当于 除2的n次幂 adc_v = tmp; adc_v = ((long)adc_v*5000/1023); OverFlag = 0; GO_DONE = 1; } DisplayData(adc_v); } } void DisplayData (unsigned int iData ) { char i=0,j=0;// char k = 0,NumStr[ 5 ]={0,0,0,0,0}; NumStr[1]=iData / 1000;//取整 NumStr[2]=iData % 1000/100; NumStr[3]=iData % 100/10; NumStr[4]=iData % 10; for(i=0;i<10;i++) { SEG_BITSEL_PORT = k =0X01; for(j=0;j<=4;j++) { SEG_BITSEL_PORT = k; if(j==1) { SEG_FONT_PORT = Seg7TableN[NumStr[1]]&0b01111111; } else { SEG_FONT_PORT = Seg7TableN[NumStr[j]]; } delayms(5); k = k <<1;//把1向左移1为显示 } } } void delayms (int ms) { int i=0,j =0; for(i=0;i < ms;i++) for(j =0; j < DLY_MS;j++) {;} } //仿真结果,单片机数码管显示全是0,与设计的测量电阻电压不对,希望大家来找茬,这原因与结果 1436浏览量 0回复量 关注量 -
HC32L136K8TA的LpUart通信不上
[color=#444444][backcolor=rgb(255, 255, 255)][font=Tahoma, "][size=16px]把官方历程lpuart_int里面的LpUart1修改为我实际使用的LpUart0(PC04-TXD PC05-RXD),一直通信不上,发送接收都没反应,硬件排查没什么问题。用另外1个非低功耗的串口Uart0是正常的。[/size][/font][/backcolor][/color] [color=#444444][backcolor=rgb(255, 255, 255)][font=Tahoma, "][size=16px]/******************************************************************************[/size][/font][/backcolor][/color] [color=#444444][backcolor=rgb(255, 255, 255)][font=Tahoma, "][size=16px]* Include files[/size][/font][/backcolor][/color] [color=#444444][backcolor=rgb(255, 255, 255)][font=Tahoma, "][size=16px]******************************************************************************/[/size][/font][/backcolor][/color] [color=#444444][backcolor=rgb(255, 255, 255)][font=Tahoma, "][size=16px]#include "ddl.h"[/size][/font][/backcolor][/color] [color=#444444][backcolor=rgb(255, 255, 255)][font=Tahoma, "][size=16px]#include "lpuart.h"[/size][/font][/backcolor][/color] [color=#444444][backcolor=rgb(255, 255, 255)][font=Tahoma, "][size=16px]#include "lpm.h"[/size][/font][/backcolor][/color] [color=#444444][backcolor=rgb(255, 255, 255)][font=Tahoma, "][size=16px]#include "gpio.h"[/size][/font][/backcolor][/color] [color=#444444][backcolor=rgb(255, 255, 255)][font=Tahoma, "][size=16px]#include "sysctrl.h"[/size][/font][/backcolor][/color] [color=#444444][backcolor=rgb(255, 255, 255)][font=Tahoma, "][size=16px]/******************************************************************************[/size][/font][/backcolor][/color] [color=#444444][backcolor=rgb(255, 255, 255)][font=Tahoma, "][size=16px]* Local pre-processor symbols/macros ('#define') [/size][/font][/backcolor][/color] [color=#444444][backcolor=rgb(255, 255, 255)][font=Tahoma, "][size=16px]******************************************************************************/[/size][/font][/backcolor][/color] [color=#444444][backcolor=rgb(255, 255, 255)][font=Tahoma, "][size=16px]/******************************************************************************[/size][/font][/backcolor][/color] [color=#444444][backcolor=rgb(255, 255, 255)][font=Tahoma, "][size=16px]* Global variable definitions (declared in header file with 'extern')[/size][/font][/backcolor][/color] [color=#444444][backcolor=rgb(255, 255, 255)][font=Tahoma, "][size=16px]******************************************************************************/[/size][/font][/backcolor][/color] [color=#444444][backcolor=rgb(255, 255, 255)][font=Tahoma, "][size=16px]/******************************************************************************[/size][/font][/backcolor][/color] [color=#444444][backcolor=rgb(255, 255, 255)][font=Tahoma, "][size=16px]* Local type definitions ('typedef') [/size][/font][/backcolor][/color] [color=#444444][backcolor=rgb(255, 255, 255)][font=Tahoma, "][size=16px]******************************************************************************/[/size][/font][/backcolor][/color] [color=#444444][backcolor=rgb(255, 255, 255)][font=Tahoma, "][size=16px]/******************************************************************************[/size][/font][/backcolor][/color] [color=#444444][backcolor=rgb(255, 255, 255)][font=Tahoma, "][size=16px]* Local function prototypes ('static')[/size][/font][/backcolor][/color] [color=#444444][backcolor=rgb(255, 255, 255)][font=Tahoma, "][size=16px]******************************************************************************/[/size][/font][/backcolor][/color] [color=#444444][backcolor=rgb(255, 255, 255)][font=Tahoma, "][size=16px]/******************************************************************************[/size][/font][/backcolor][/color] [color=#444444][backcolor=rgb(255, 255, 255)][font=Tahoma, "][size=16px]* Local variable definitions ('static') *[/size][/font][/backcolor][/color] [color=#444444][backcolor=rgb(255, 255, 255)][font=Tahoma, "][size=16px]******************************************************************************/[/size][/font][/backcolor][/color] [color=#444444][backcolor=rgb(255, 255, 255)][font=Tahoma, "][size=16px]uint8_t u8TxData[2] = {0x00,0x55};[/size][/font][/backcolor][/color] [color=#444444][backcolor=rgb(255, 255, 255)][font=Tahoma, "][size=16px]uint8_t u8RxData = 00;[/size][/font][/backcolor][/color] [color=#444444][backcolor=rgb(255, 255, 255)][font=Tahoma, "][size=16px]/*****************************************************************************[/size][/font][/backcolor][/color] [color=#444444][backcolor=rgb(255, 255, 255)][font=Tahoma, "][size=16px]* Function implementation - global ('extern') and local ('static')[/size][/font][/backcolor][/color] [color=#444444][backcolor=rgb(255, 255, 255)][font=Tahoma, "][size=16px]******************************************************************************/[/size][/font][/backcolor][/color] [color=#444444][backcolor=rgb(255, 255, 255)][font=Tahoma, "][size=16px]void App_LpUartPortCfg(void);[/size][/font][/backcolor][/color] [color=#444444][backcolor=rgb(255, 255, 255)][font=Tahoma, "][size=16px]void App_LpUartCfg(void);[/size][/font][/backcolor][/color] [color=#444444][backcolor=rgb(255, 255, 255)][font=Tahoma, "][size=16px]/**[/size][/font][/backcolor][/color] [color=#444444][backcolor=rgb(255, 255, 255)][font=Tahoma, "][size=16px]******************************************************************************[/size][/font][/backcolor][/color] [color=#444444][backcolor=rgb(255, 255, 255)][font=Tahoma, "][size=16px]** \brief Main function of project[/size][/font][/backcolor][/color] [color=#444444][backcolor=rgb(255, 255, 255)][font=Tahoma, "][size=16px]**[/size][/font][/backcolor][/color] [color=#444444][backcolor=rgb(255, 255, 255)][font=Tahoma, "][size=16px]** \return uint32_t return value, if needed[/size][/font][/backcolor][/color] [color=#444444][backcolor=rgb(255, 255, 255)][font=Tahoma, "][size=16px]**[/size][/font][/backcolor][/color] [color=#444444][backcolor=rgb(255, 255, 255)][font=Tahoma, "][size=16px]** This sample[/size][/font][/backcolor][/color] [color=#444444][backcolor=rgb(255, 255, 255)][font=Tahoma, "][size=16px]**[/size][/font][/backcolor][/color] [color=#444444][backcolor=rgb(255, 255, 255)][font=Tahoma, "][size=16px]******************************************************************************/[/size][/font][/backcolor][/color] [color=#444444][backcolor=rgb(255, 255, 255)][font=Tahoma, "][size=16px]int32_t main(void)[/size][/font][/backcolor][/color] [color=#444444][backcolor=rgb(255, 255, 255)][font=Tahoma, "][size=16px]{ [/size][/font][/backcolor][/color] [color=#444444][backcolor=rgb(255, 255, 255)][font=Tahoma, "][size=16px] ///< 端口配置[/size][/font][/backcolor][/color] [color=#444444][backcolor=rgb(255, 255, 255)][font=Tahoma, "][size=16px] App_LpUartPortCfg();[/size][/font][/backcolor][/color] [color=#444444][backcolor=rgb(255, 255, 255)][font=Tahoma, "][size=16px] ///< LPUART配置[/size][/font][/backcolor][/color] [color=#444444][backcolor=rgb(255, 255, 255)][font=Tahoma, "][size=16px] App_LpUartCfg();[/size][/font][/backcolor][/color] [color=#444444][backcolor=rgb(255, 255, 255)][font=Tahoma, "][size=16px] //发送数据[/size][/font][/backcolor][/color] [color=#444444][backcolor=rgb(255, 255, 255)][font=Tahoma, "][size=16px] LPUart_SendDataIt(M0P_LPUART0, 0x55); [/size][/font][/backcolor][/color] [color=#444444][backcolor=rgb(255, 255, 255)][font=Tahoma, "][size=16px] while(1)[/size][/font][/backcolor][/color] [color=#444444][backcolor=rgb(255, 255, 255)][font=Tahoma, "][size=16px] {[/size][/font][/backcolor][/color] [color=#444444][backcolor=rgb(255, 255, 255)][font=Tahoma, "][size=16px] ;[/size][/font][/backcolor][/color] [color=#444444][backcolor=rgb(255, 255, 255)][font=Tahoma, "][size=16px] }[/size][/font][/backcolor][/color] [color=#444444][backcolor=rgb(255, 255, 255)][font=Tahoma, "][size=16px]}[/size][/font][/backcolor][/color] [color=#444444][backcolor=rgb(255, 255, 255)][font=Tahoma, "][size=16px]///
3068浏览量 2回复量 关注量 -
HC32L136K8TA的LpUart通信不上 sos
把官方历程lpuart_int里面的LpUart1修改为我实际使用的LpUart0(PC04-TXD PC05-RXD),一直通信不上,发送接收都没反应,硬件排查没什么问题。用另外1个非低功耗的串口Uart0是正常的。 /****************************************************************************** * Include files ******************************************************************************/ #include "ddl.h" #include "lpuart.h" #include "lpm.h" #include "gpio.h" #include "sysctrl.h" /****************************************************************************** * Local pre-processor symbols/macros ('#define') ******************************************************************************/ /****************************************************************************** * Global variable definitions (declared in header file with 'extern') ******************************************************************************/ /****************************************************************************** * Local type definitions ('typedef') ******************************************************************************/ /****************************************************************************** * Local function prototypes ('static') ******************************************************************************/ /****************************************************************************** * Local variable definitions ('static') * ******************************************************************************/ uint8_t u8TxData[2] = {0x00,0x55}; uint8_t u8RxData = 00; /***************************************************************************** * Function implementation - global ('extern') and local ('static') ******************************************************************************/ void App_LpUartPortCfg(void); void App_LpUartCfg(void); /** ****************************************************************************** ** \brief Main function of project ** ** \return uint32_t return value, if needed ** ** This sample ** ******************************************************************************/ int32_t main(void) { ///< 端口配置 App_LpUartPortCfg(); ///< LPUART配置 App_LpUartCfg(); //发送数据 LPUart_SendDataIt(M0P_LPUART0, 0x55); while(1) { ; } } ///
2169浏览量 0回复量 关注量 -
dsPIC33EP64GS505汇编与C混合编程问题
[align=left]您好:[/align][align=left]我想在汇编文件中调用C文件定义的变量,但编译报错,具体做法和报错情况如下:[/align][align=left]C头文件(.h):[/align][align=left]#include "xc.h"[/align][align=left]#include
[/align][align=left]extern int16_t dcmCorrFactor[/align][align=left]C源文件(.C):[/align][align=left]#include "Variables_s.h"[/align][align=left]int16_t dcmCorrFactor = 32767;[/align][align=left]汇编文件(.S):[/align][align=left]#include "Variables_s.h"[/align][align=left].include "p33Exxxx.inc"[/align][align=left]mov _dcmCorrFactor , w12 [/align][align=left] [/align][align=left]编译时报错:[/align][align=left]\support\dsPIC33E\h/p33EP64GS505.h:26785:Error: Invalid mnemonic: 'extern'[/align][align=left]感觉像是头文件调用冲突了[/align][align=left]麻烦哪位大神帮忙指导下,如何处理,万分感谢!!![/align] 2711浏览量 5回复量 关注量 -
为什么按下S5后定时器没有打开去掉nowshidu=dat_rd1*20就可以了
#include
#include"ds1302.h" #include"iic.h" sbit S7=P3^0; sbit S6=P3^1; sbit S5=P3^2; sbit S4=P3^3; unsigned char dat_rd2; unsigned char kaiguan=0; unsigned char shidu=50; //初始湿度 unsigned char nowshidu; //当前湿度 unsigned char code table[]={0xc0,0xf9,0xA4,0xB0,0x99,0x92,0x82,0xF8, 0x80,0x90,0x88,0x83,0xA7,0xA1,0x86,0x8E,0xbf,0x7f}; unsigned char write[]={0x80,0x82,0x84,0x86,0x88,0x8a,0x8c}; unsigned char read[]={0x81,0x83,0x85,0x87,0x89,0x8b,0x8d}; unsigned char Time[]={0x16,0x30,0x08,0x02,0x16,0x02,0x21}; void delayms(unsigned char x) { unsigned char i; while(x--) { for(i=0;i<113;i++); } } void select (unsigned char n) { switch(n) { case 4: P2=(P2&0x1f)|0x80; break; case 5: P2=(P2&0x1f)|0xa0; break; case 6: P2=(P2&0x1f)|0xc0; break; case 7: P2=(P2&0x1f)|0xe0; break; } } void guanbi() { select(5); P0=0x00; select(4); P0=0xff; } void DS1302_write() { unsigned char i; Ds1302_Single_Byte_Write(0x8e,0x00); for(i=0;i<7;i++) { Ds1302_Single_Byte_Write(write[i],Time[i]); } Ds1302_Single_Byte_Write(0x8e,0x80); } void DS1302_read() { unsigned char i; for(i=0;i<7;i++) { Time[i]=Ds1302_Single_Byte_Read(read[i]); } } void read_rd2() { IIC_Start(); IIC_SendByte(0x90); IIC_WaitAck(); IIC_SendByte(0x03); IIC_WaitAck(); IIC_Start(); IIC_SendByte(0x91); IIC_WaitAck(); dat_rd2=IIC_RecByte(); IIC_WaitAck(); IIC_Ack(0); IIC_Stop(); } void shuma(unsigned char pos,unsigned char date) { select(6); P0=0x01< shidu) { select(5); P0=0x40; } else if(nowshidu 2984浏览量 1回复量 关注量 -
谁能帮我看看n76e003可调电源的程序
开机后oled上ADC电压值有变化,旋转编码器后,oled就显示一个值没有变化 #include
#include "N76E003.h" #include "Common.h" #include "Delay.h" #include "SFR_Macro.h" #include "Function_Define.h" #include "oled.h" #include "bmp.h" UINT8 temp=0xD7; UINT8 temp1=0x02; void ADC_ISR (void) interrupt 11 { if(ADCF) { clr_ADCF; set_ADCS; //printf ("\n Value = 0x%bx",ADCRH); } } void show() { uint16_t BandGap_H, BandGap_L,BandGap_v; uint16_t voltage = 0; char aa[10]; float v; BandGap_H = ADCRH; BandGap_L = ADCRL; BandGap_v = BandGap_H << 4 | BandGap_L; v=(float)BandGap_v*(3.3/4096); v*=10; sprintf(aa,"%5.2f",v); OLED_ShowString(0,0,aa); } void main (void) { // unsigned char t; // uint16_t BandGap_H, BandGap_L,BandGap_v,temp; // uint16_t voltage = 0; // // char aa[10]; // float v; Set_All_GPIO_Quasi_Mode; // Define in Function_define.h P17_Input_Mode; P30_Input_Mode; set_EPI; clr_PIPS1; set_PIPS0; Enable_BIT7_RasingEdge_Trig; Enable_ADC_AIN2; // Enable AIN0 P1.7 as ADC input set_EADC; // Enable ADC interrupt (if use interrupt) set_EPWM;//?? PWM_INT_PWM4; PWM_FALLING_INT; PWM4_P01_OUTPUT_ENABLE; clr_PWMTYP;//?????? clr_PWMMOD0;//????????? clr_PWMMOD1; PWM_CLOCK_DIV_8;//8???? PWMPH = 0x07; //Setting PWM value PWMPL = 0xCF; set_SFRPAGE;//PWM4 and PWM5 duty seting is in SFP page 1 PWM4H = 0x02;//500(Dec) PWM4L = 0xD7; clr_SFRPAGE; set_LOAD; // PWM run set_PWMRUN; set_EA; set_ADCS; InitialUART0_Timer3(115200); set_CLOEN; OLED_Init(); //³õʼ»¯OLED // t=' '; while(1) { show(); Timer0_Delay1ms(300); } } void PWMISR() interrupt 13 { if(PWMF)//???????? { clr_LOAD;//???????? clr_PWMF;//??PWM????? set_SFRPAGE;//PWM4 and PWM5 duty seting is in SFP page 1 PWM4H=temp1; PWM4L=temp; clr_SFRPAGE; set_LOAD;//????,???? clr_PWMF; } } void PinInterrupt (void) interrupt 7 { if(PIF==0x80&&P17) { Timer0_Delay1ms(1); if(P17) { if(P30) { temp+=30; if(temp<30) { if(temp1==7){temp=0xc0;}else{temp1+=1;}} //Timer0_Delay1ms(500); } else{ temp-=30; if(temp<30){ if(temp1==0){temp=0x30;}else{temp1-=1;temp=0xff;}} //Timer0_Delay1ms(500); } } } PIF=0; PWMF=1; } 900浏览量 4回复量 关注量 -
新手51单片机流水灯程序问题请教
[color=#333333][backcolor=rgb(255, 255, 255)][font=微软雅黑][size=16px]#include
[/size][/font][/backcolor][/color] [color=#333333][backcolor=rgb(255, 255, 255)][font=微软雅黑][size=16px]#include [/size][/font][/backcolor][/color] [color=#333333][backcolor=rgb(255, 255, 255)][font=微软雅黑][size=16px]void delay(void) [/size][/font][/backcolor][/color] [color=#333333][backcolor=rgb(255, 255, 255)][font=微软雅黑][size=16px] {[/size][/font][/backcolor][/color] [color=#333333][backcolor=rgb(255, 255, 255)][font=微软雅黑][size=16px] unsigned int i,j,k; [/size][/font][/backcolor][/color] [color=#333333][backcolor=rgb(255, 255, 255)][font=微软雅黑][size=16px] for(i=20;i>0;i--) [/size][/font][/backcolor][/color] [color=#333333][backcolor=rgb(255, 255, 255)][font=微软雅黑][size=16px] for(j=20;j>0;j--)[/size][/font][/backcolor][/color] [color=#333333][backcolor=rgb(255, 255, 255)][font=微软雅黑][size=16px] for(k=248;k>0;k--);[/size][/font][/backcolor][/color] [color=#333333][backcolor=rgb(255, 255, 255)][font=微软雅黑][size=16px] }[/size][/font][/backcolor][/color] [color=#333333][backcolor=rgb(255, 255, 255)][font=微软雅黑][size=16px] void main() [/size][/font][/backcolor][/color] [color=#333333][backcolor=rgb(255, 255, 255)][font=微软雅黑][size=16px] {[/size][/font][/backcolor][/color] [color=#333333][backcolor=rgb(255, 255, 255)][font=微软雅黑][size=16px] int temp;[/size][/font][/backcolor][/color] [color=#333333][backcolor=rgb(255, 255, 255)][font=微软雅黑][size=16px] temp=0x01;[/size][/font][/backcolor][/color] [color=#333333][backcolor=rgb(255, 255, 255)][font=微软雅黑][size=16px] while(1)[/size][/font][/backcolor][/color] [color=#333333][backcolor=rgb(255, 255, 255)][font=微软雅黑][size=16px] [/size][/font][/backcolor][/color] [color=#333333][backcolor=rgb(255, 255, 255)][font=微软雅黑][size=16px] {[/size][/font][/backcolor][/color] [color=#333333][backcolor=rgb(255, 255, 255)][font=微软雅黑][size=16px] [/size][/font][/backcolor][/color] [color=#333333][backcolor=rgb(255, 255, 255)][font=微软雅黑][size=16px] P1=~temp;[/size][/font][/backcolor][/color] [color=#333333][backcolor=rgb(255, 255, 255)][font=微软雅黑][size=16px] delay();[/size][/font][/backcolor][/color] [color=#333333][backcolor=rgb(255, 255, 255)][font=微软雅黑][size=16px] P1=0xff;[/size][/font][/backcolor][/color] [color=#333333][backcolor=rgb(255, 255, 255)][font=微软雅黑][size=16px] temp=temp<<1;[/size][/font][/backcolor][/color] [color=#333333][backcolor=rgb(255, 255, 255)][font=微软雅黑][size=16px] if (temp==0x00)[/size][/font][/backcolor][/color] [color=#333333][backcolor=rgb(255, 255, 255)][font=微软雅黑][size=16px] temp=0x01;[/size][/font][/backcolor][/color] [color=#333333][backcolor=rgb(255, 255, 255)][font=微软雅黑][size=16px] }[/size][/font][/backcolor][/color] [color=#333333][backcolor=rgb(255, 255, 255)][font=微软雅黑][size=16px] [/size][/font][/backcolor][/color] [color=#333333][backcolor=rgb(255, 255, 255)][font=微软雅黑][size=16px] }[/size][/font][/backcolor][/color] [color=#333333][backcolor=rgb(255, 255, 255)][font=微软雅黑][size=16px]想要用[/size][/font][/backcolor][/color][color=rgb(65, 131, 196)][backcolor=rgb(255, 255, 255)][font=微软雅黑][size=16px]单片机[/size][/font][/backcolor][/color][color=#333333][backcolor=rgb(255, 255, 255)][font=微软雅黑][size=16px]左位移[/size][/font][/backcolor][/color][color=rgb(210, 34, 34)][backcolor=rgb(255, 255, 255)][font=微软雅黑][size=16px]指令[/size][/font][/backcolor][/color][color=#333333][backcolor=rgb(255, 255, 255)][font=微软雅黑][size=16px]实现流水灯,程序正确,调试也显示正确,在[/size][/font][/backcolor][/color][color=rgb(65, 131, 196)][backcolor=rgb(255, 255, 255)][font=微软雅黑][size=16px]单片[/size][/font][/backcolor][/color][color=#333333][backcolor=rgb(255, 255, 255)][font=微软雅黑][size=16px]机上运行了一遍也是可以实现,问题在于,当第八个[/size][/font][/backcolor][/color][color=rgb(65, 131, 196)][backcolor=rgb(255, 255, 255)][font=微软雅黑][size=16px]LED[/size][/font][/backcolor][/color][color=#333333][backcolor=rgb(255, 255, 255)][font=微软雅黑][size=16px]熄灭后,要等很长时间后第一个LED才会重新亮起,[/size][/font][/backcolor][/color] 1238浏览量 8回复量 关注量