–From Hunan University of Technology & Nanhua University
Mr. Chen Zhu’s team
In this issue, we push the school-enterprise cooperation case of DWIN Technology–Full-automatic Intelligent Nucleic Acid Extractor. The solution has an intuitive operation interface, real-time monitoring of equipment status, temperature, time and other information through the screen, and can be adjusted through the parameters, and integrated with UV disinfection, password modification and other practical functions, which enhances the convenience of the experimental operation and the security of the data. At the same time, the equipment also supports experiment start, pause and end operations, as well as HEAP and LED light control, further ensuring the accuracy and reliability of the experiment.
【C51 Code】
C51 has a large amount of code, here is an example of the main function code and the processing code of various controls.
Main function:
#include “sys.h”
#include “uart4.h”
#include “uart5.h”
#include “touch.h”
#include “tim0.h”
#include “norflash.h”
#include “lab.h”
void main(void)
{
sys_init();
uart4_init(9600);
uart5_init(9600);
timer0_cnt_init();
page_change(25);
touch_init();
while(1)
{
val_addr_handler();
lab_time_handler();
Uart4_Rx_handler();
}
}
Control handling code::
void val_addr_handler(void)
{
#define VAL_START_ADDR 0×5000
u8 n;
if(is_addr_scan==0)
{
return;
}
is_addr_scan=0;
if(dwkey_show_scan==1)
{
keyshow_scan(DW_KEY_ADDR,DW_KEYSHOW_ADDR);
keyshow_scan(DW_OLDKEY_ADDR,DW_OLDKEYSHOW_ADDR);
keyshow_scan(DW_CHANGEKEY1_ADDR,DW_CHANGEKEY1SHOW_ADDR);
keyshow_scan(DW_CHANGEKEY2_ADDR,DW_CHANGEKEY2SHOW_ADDR);
}
dwkey_show_scan=0;
sys_read_vp(VAL_START_ADDR,(u8*)&cur_scan_val,SCANLEN); for(n=0;n<SCANLEN;n++)
for(n=0;n<SCANLEN;n++)
{
if(n<=0×05)
{
if(cur_scan_val[n]>0)
{
lab_data_run_view(n);
lab_pop_clear(n,0);
}
}
else if(n==0×06)
{
if(cur_scan_val[n]>0)
{
page_id_update(cur_scan_val[n]);
lab_pop_clear(n,0);
}
}
else if(n==0×07)
{
if(cur_scan_val[n]!=last_scan_val[n])
{
lab_led_con(cur_scan_val[n]);
last_scan_val[n] = cur_scan_val[n];
}
}
else if(n==0×08)
{
if(cur_scan_val[n]>0)
{
lab_uv_con(cur_scan_val[n]);
lab_pop_clear(n,0);
}
}
else if(n==0×09)
{
if(cur_scan_val[n]!=last_scan_val[n])
{
lab_heap_con(cur_scan_val[n]);
last_scan_val[n] = cur_scan_val[n];
}
}
else if(n==0x0A)
{
if(cur_scan_val[n]>0)
{
lab_data_save();
lab_pop_clear(n,0);
}
}
else if(n==0x0B)
{
if(cur_scan_val[n]>0)
{
lab_data_default(n);
lab_pop_clear(n,0);
}
}
else if(n==0x0C)
{
if(cur_scan_val[n]>0)
{
lab_data_modify();
lab_pop_clear(n,0);
}
}
else if(n==0x0D)
{
if(cur_scan_val[n]>0)
{
lab_data_detele();
lab_pop_clear(n,0);
}
}
else if(n==0x0E)
{
if(cur_scan_val[n]>0)
{
lab_start();
lab_pop_clear(n,0);
}
}
else if(n==0x0F)
{
if(cur_scan_val[n]>0)
{
lab_end(1);
lab_pop_clear(n,0);
}
}
else if(n==0×10)
{
if(cur_scan_val[n]!=last_scan_val[n])
{
lab_pause_cont(cur_scan_val[n]);
last_scan_val[n] = cur_scan_val[n];
}
}
else if(n==0×11)
{
if(cur_scan_val[n]>0)
{
lab_page_status(n);
lab_pop_clear(n,0);
}
lab_wash_chooose();
}
else if(n==0×12)
{
if(cur_scan_val[n]>0)
{
lab_data_clear();
lab_pop_clear(n,0);
}
}
else if(n==0×13)
{
if(cur_scan_val[n]>0)
{
cur_scan_val[n] = 0;
sys_write_vp(0×5013,(u8*)&cur_scan_val,1);
touch_lock();
}
}
else if(n==0×14)
{
if(cur_scan_val[n]>0)
{
cur_scan_val[n] = 0;
sys_write_vp(0×5014,(u8*)&cur_scan_val,1);
touch_changekey();
}
}
}
}
Post time: May-27-2024