-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain_node.c
More file actions
80 lines (72 loc) · 1.25 KB
/
Copy pathmain_node.c
File metadata and controls
80 lines (72 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#include <REG51.H>
#include <stdio.h>
#include "Delay.h"
#include "LCD.h"
#include "BDE0700.h"
#include "KXTJ9.h"
#include "ADS1000.h"
#include "BlueUART.h"
#include "tmp100.h"
#include "UVMeter.h"
#define ANum 1
int a_time=0;
int a_count=0;
int cnt=0;
uint temperaqture;
unsigned char payload[1+2+6*ANum+2];
void main()
{
//int acc_x,acc_y,acc_z;
int tmp = 0xAAAA;
unsigned char i;
unsigned char ini_cnt;
//Initialize
Ht1621_Init();
Ht1621WrAllData();
LCD_show(0xFFFF);wait(1,1000);
// tmp100
if(cnt){
tmpInit(); // Init, Res12/RanH/Mod0
tmpSetRes(3); // Set Resolution (0-9/1-10/2-11/3-12)
tmpSetRange(1); // Set Range (0:L/1:H)
tmpSetMode(0); // Set Mode (0:Continuous/1:ShutDown)
}
if(1){
// UV_Meter
uvReset();
uvPre();
setForceMode();
setALSVISMode();
}
LCD_show(0x7777);wait(3,1000);
payload[0]=1;
ini_cnt=0;
i=1;
while(1)
{
//initialization
/*if(ini_cnt==50)
{
Ht1621_Init();
ini_cnt=1;
}*/
//tmpGetTmpCont(&tmp);
startForceMeas();
getALSVISData(&tmp);
//circleData(&tmp);
//uvPre();
cnt++;
if(cnt==1)
{
LCD_show(tmp);
BlueTooth_Send(payload, 1);
wait(3,1000);
}
if(cnt==2){
LCD_show(payload[0]++);
BlueTooth_Send(payload, 1);
wait(2,1000);
cnt=0;
}
}
}