芯片解密|单片机解密|IC解密|芯片破解|芯片复制| PCB抄板|软件开发

飞芯科技-芯片解密|单片机解密|IC解密|芯片破解|芯片复制| PCB抄板|软件开发

芯片复制基于stm32的水质检测源程序

  1. 芯片复制#include "stm32f10x.h"
  2. 芯片复制#include "bsp-lcd1602.h"
  3. 芯片复制#include "delay.h"
  4. 芯片复制#include "sys.h"
  5. 芯片复制#include "adc.h"

  6. char PH_High = 7;
  7. char zuodu_High = 50;


  8. void LED( void )
  9. {
  10.         GPIO_InitTypeDef GPIO_InitStructure;         
  11.         
  12.         RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA, ENABLE);
  13.         GPIO_InitStructure.GPIO_Pin = GPIO_Pin_10;
  14.         GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
  15.         GPIO_InitStructure.GPIO_Speed = GPIO_Speed_10MHz;
  16.         GPIO_Init(GPIOA, &GPIO_InitStructure);        
  17.         GPIO_SetBits( GPIOA,GPIO_Pin_10 );
  18.         
  19. }


  20. int main(void)
  21. {
  22.   int ADC_num;
  23.         int temp1,temp2;
  24.         
  25.         ADC1_GPIO_Config();
  26.   ADC_Config();           
  27.         LCD1602_Init();
  28.         LCD1602_ShowStr(0,1,"zd_S:50% PH_S:7",15);
  29.         LCD1602_ShowStr(0,0,"zd:      PH:   ",15);
  30.         LED();
  31.         
  32.         while(1)
  33.         {
  34.                 ADC_num=Get_ADC(ADC_Channel_0);
  35.                 temp1=ADC_num*100/4096;
  36.                 LCD1602_WriteCmd( 0x80 + 3 );
  37.                 LCD1602_WriteDat( temp1/10 + 0x30 );
  38.                 LCD1602_WriteDat( temp1%10 + 0x30 );
  39.                 LCD1602_WriteDat( '%' );
  40.                
  41.                 ADC_num=Get_ADC(ADC_Channel_1);
  42.                 temp2=ADC_num*10/4096;
  43.                 LCD1602_WriteCmd( 0x80 + 13 );
  44.                 LCD1602_WriteDat( temp2 + 0x30 );
  45.                
  46.                 if(( temp1 >= 50 )||( temp2 >= 7 ))
  47.                 {
  48.                         GPIO_ResetBits( GPIOA,GPIO_Pin_10 );
  49.                 }
  50.                 else
  51.                 {
  52.                         GPIO_SetBits( GPIOA,GPIO_Pin_10 );
  53.                 }
  54.         }
  55. }


  56. 3、main函数
  57. #include "stm32f10x.h"
  58. #include "bsp-lcd1602.h"
  59. #include "delay.h"
  60. #include "sys.h"
  61. #include "adc.h"

  62. char PH_High = 7;
  63. char zuodu_High = 50;


  64. void LED( void )
  65. {
  66.         GPIO_InitTypeDef GPIO_InitStructure;         
  67.         
  68.         RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA, ENABLE);
  69.         GPIO_InitStructure.GPIO_Pin = GPIO_Pin_10;
  70.         GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
  71.         GPIO_InitStructure.GPIO_Speed = GPIO_Speed_10MHz;
  72.         GPIO_Init(GPIOA, &GPIO_InitStructure);        
  73.         GPIO_SetBits( GPIOA,GPIO_Pin_10 );
  74.         
  75. }


  76. int main(void)
  77. {
  78.   int ADC_num;
  79.         int temp1,temp2;
  80.         
  81.         ADC1_GPIO_Config();
  82.   ADC_Config();           
  83.         LCD1602_Init();
  84.         LCD1602_ShowStr(0,1,"zd_S:50% PH_S:7",15);
  85.         LCD1602_ShowStr(0,0,"zd:      PH:   ",15);
  86.         LED();
  87.         
  88.         while(1)
  89.         {
  90.                 ADC_num=Get_ADC(ADC_Channel_0);
  91.                 temp1=ADC_num*100/4096;
  92.                 LCD1602_WriteCmd( 0x80 + 3 );
  93.                 LCD1602_WriteDat( temp1/10 + 0x30 );
  94.                 LCD1602_WriteDat( temp1%10 + 0x30 );
  95.                 LCD1602_WriteDat( '%' );
  96.                
  97.                 ADC_num=Get_ADC(ADC_Channel_1);
  98.                 temp2=ADC_num*10/4096;
  99.                 LCD1602_WriteCmd( 0x80 + 13 );
  100.                 LCD1602_WriteDat( temp2 + 0x30 );
  101.                
  102.                 if(( temp1 >= 50 )||( temp2 >= 7 ))
  103.                 {
  104.                         GPIO_ResetBits( GPIOA,GPIO_Pin_10 );
  105.                 }


联系方式

地址:石家庄市新华区民族路77号华强广场D座2009
电话:0311-88816616/87087811
手机:13315190088
传真:0311-67901001
联系人:张工
网址:www.feixindz.com
邮箱:feixindz@163.com
微信:xinpianjiemi
QQ:527263666/568069805

在线客服
热线电话

企业微信