-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathEasyHive.h
executable file
·59 lines (44 loc) · 1.63 KB
/
EasyHive.h
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
#ifndef EasyHive_h
#define EasyHive_h
#define EASYHIVE "0.0.1"
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//pin assignments
#define CLK_PIN WEIGHT_CLK
#define DATA_PIN WEIGHT_DATA
#define PDWN WEIGHT_PDWN
#define TEMP WEIGHT_TEMP
// Data wire is plugged into port 2 on the Arduino
#define ONE_WIRE_BUS SARA_TX_ENABLE
// text conversion functions
#define HEX_CHAR_TO_NIBBLE(c) ((c >= 'A') ? (c - 'A' + 0x0A) : (c - '0'))
#define HEX_PAIR_TO_BYTE(h, l) ((HEX_CHAR_TO_NIBBLE(h) << 4) + HEX_CHAR_TO_NIBBLE(l))
// pin definitions
#define powerPin 7 // this is a pin not used on the m0EasyHiveBoard, but needed for library functionality
#define enablePin 7 // this is a pin not used on the m0EasyHiveBoard, but needed for library functionality
#define DEBUG_STREAM SerialUSB
#define DEBUG_STREAM_BAUD 115200
#define MODEM_STREAM Serial1
#define STARTUP_DELAY 5000
// define udp msg length
#define STDSTRINGLEN 30
void init_LEDs(void);
void LEDs_off(void);
void LEDs_green(void);
void LEDs_red(void);
void LEDs_blue(void);
void init_Weight(void);
void init_Temp(void);
float get_Weight(void);
long get_Weight_raw(void);
void set_Weight_calib(float val_c, float val_o);
void get_Weight_calib(float* val_c, float* val_o);
float get_Temp(void);
void enable_USB_in(void);
void serialEvent(void);
void check_USB_in(void);
const char* sendMessageThroughUDP(const char param[STDSTRINGLEN]);
void checkMessage(const char msg[STDSTRINGLEN]);
#endif