-
Notifications
You must be signed in to change notification settings - Fork 487
/
commands.js
84 lines (79 loc) · 3.27 KB
/
commands.js
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
81
82
83
84
module.exports = {
//Command Format
// digitalRead() command format header
dRead : [1]
// digitalWrite() command format header
, dWrite : [2]
// analogRead() command format header
, aRead : [3]
// analogWrite() command format header
, aWrite : [4]
// pinMode() command format header
, pMode : [5]
// Ultrasonic read
, uRead : [7]
// Get firmware version
, version : [8]
// Accelerometer (+/- 1.5g) read
, acc_xyz : [20]
// RTC get time
, rtc_getTime : [30]
// DHT Pro sensor temperature
, dht_temp : [40]
// Grove LED Bar commands
// Initialise
, ledBarInit : [50]
// Set orientation
, ledBarOrient : [51]
// Set level
, ledBarLevel : [52]
// Set single LED
, ledBarSetOne : [53]
// Toggle single LED
, ledBarToggleOne : [54]
// Set all LEDs
, ledBarSet : [55]
// Get current state
, ledBarGet : [56]
// Grove 4 Digit Display commands
// Initialise
, fourDigitInit : [70]
// Set brightness, not visible until next cmd
, fourDigitBrightness : [71]
// Set numeric value without leading zeros
, fourDigitValue : [72]
// Set numeric value with leading zeros
, fourDigitValueZeros : [73]
// Set individual digit
, fourDigitIndividualDigit : [74]
// Set individual leds of a segment
, fourDigitIndividualLeds : [75]
// Set left and right values with colon
, fourDigitScore : [76]
// Analog read for n seconds
, fourDigitAnalogRead : [77]
// Entire display on
, fourDigitAllOn : [78]
// Entire display off
, fourDigitAllOff : [79]
// Grove Chainable RGB LED commands
// Store color for later use
, storeColor : [90]
// Initialise
, chainableRgbLedInit : [91]
// Initialise and test with a simple color
, chainableRgbLedTest : [92]
// Set one or more leds to the stored color by pattern
, chainableRgbLedSetPattern : [93]
// Set one or more leds to the stored color by modulo
, chainableRgbLedSetModulo : [94]
// Sets leds similar to a bar graph, reversible
, chainableRgbLedSetLevel : [95]
// Grove IR sensor
// Read the button from IR sensor
, irRead : [21]
// Set pin for the IR reciever
, irRecvPin : [22]
// This allows us to be more specific about which commands contain unused bytes
, unused : 0
};