FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
ExampleCode/bash/brihtPi.sh at master · PhysicsX/ExampleCode · GitHub
PhysicsX
/
ExampleCode
Public
Notifications
You must be signed in to change notification settings
Fork
17
Star
26
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
ExampleCode
/
bash
/
brihtPi.sh
Copy path
More file actions
More file actions
Latest commit
History
History
History
executable file
·
59 lines (53 loc) · 1.34 KB
Breadcrumbs
ExampleCode
/
bash
/
brihtPi.sh
Copy path
File metadata and controls
executable file
·
59 lines (53 loc) · 1.34 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
#!
/bin/bash
led=
$1
state=
$2
val=
$3
i2cset -y 1 0x70 0x09 0x0f
if
[
"
$led
"
=
"
flash
"
]
;
then
i2cset -y 1 0x70 0x00 0x00
i2cset -y 1 0x70 0x02 0x32
i2cset -y 1 0x70 0x04 0x32
i2cset -y 1 0x70 0x05 0x32
i2cset -y 1 0x70 0x07 0x32
i2cset -y 1 0x70 0x00 0x5a
i2cset -y 1 0x70 0x00 0x00
fi
if
[
"
$led
"
=
"
white
"
]
;
then
if
[
"
$state
"
=
"
on
"
]
;
then
echo
"
white leds are on
"
i2cset -y 1 0x70 0x00 0x5a
elif
[
"
$state
"
=
"
off
"
]
;
then
echo
"
leds off
"
i2cset -y 1 0x70 0x00 0x00
elif
[
"
$state
"
=
"
br
"
]
;
then
if
[
"
$val
"
-ge
0 ]
&&
[
"
$val
"
-le
100 ]
;
then
realval=
"
$((
$val
*
32
/
100
))
"
#
echo $realval
i2cset -y 1 0x70 0x02 0x
$realval
i2cset -y 1 0x70 0x04 0x
$realval
i2cset -y 1 0x70 0x05 0x
$realval
i2cset -y 1 0x70 0x07 0x
$realval
else
echo
"
brightness should be between 0 and 100
"
fi
fi
elif
[
"
$led
"
=
"
ir
"
]
;
then
if
[
"
$state
"
=
"
on
"
]
;
then
echo
"
ir leds are on
"
i2cset -y 1 0x70 0x00 0xa5
elif
[
"
$state
"
=
"
off
"
]
;
then
echo
"
leds off
"
i2cset -y 1 0x70 0x00 0x00
elif
[
"
$state
"
=
"
br
"
]
;
then
if
[
"
$val
"
-ge
0 ]
&&
[
"
$val
"
-le
100 ]
;
then
realval=
"
$((
$val
*
32
/
100
))
"
#
echo $realval
i2cset -y 1 0x70 0x01 0x
$realval
i2cset -y 1 0x70 0x03 0x
$realval
i2cset -y 1 0x70 0x06 0x
$realval
i2cset -y 1 0x70 0x08 0x
$realval
else
echo
"
brightness should be between 0 and 100
"
fi
fi
fi
Back
|
FazBrowse Home
|
New Git URL