#include "tcs3200.h" #include "delay.h" #include "usart.h" #include "lcd.h" float…
Jump to turn (6)
- User
#include "tcs3200.h" #include "delay.h" #include "usart.h" #include "lcd.h"
float RGB_Scale[3];
int count=0;
int cnt[3];
int flag=0;//S0-----PA4,S1-----PA5,S2-----PA6,S3-----PA7,LED-----PC5,OUT-----PA0
void TCS_GPIO_Init(void) {
GPIO_InitTypeDef GPIO_InitStructure;
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA|RCC_APB2Periph_GPIOC, ENABLE);
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_4|GPIO_Pin_5|GPIO_Pin_6|GPIO_Pin_7;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_Init(GPIOA, &GPIO_InitStructure);
GPIO_SetBits(GPIOA,GPIO_Pin_5|GPIO_Pin_6|GPIO_Pin_4|GPIO_Pin_7); //PA.4567 Êä³ö¸ßGPIO_InitStructure.GPIO_Pin = GPIO_Pin_5;
GPIO_Init(GPIOC, &GPIO_InitStructure);
GPIO_SetBits(GPIOC,GPIO_Pin_5);
}void filter(int s2,int s3) { if(s2==0&&s3==0){ S2_L;S3_L; } if(s2==0&&s3==1){ S2_L;S3_H; } if(s2==1&&s3==0){ S2_H;S3_L; } if(s2==1&&s3==1){ S2_H;S3_H; }
}void TSC_WB(int s2, int s3) { count = 0;
flag ++;
filter(s2, s3); }
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.