Skip to content

Commit bf85b59

Browse files
committed
Add MSA300 library.
Signed-off-by: Bigbits <[email protected]>
1 parent dd01f0c commit bf85b59

File tree

5 files changed

+1340
-0
lines changed

5 files changed

+1340
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#include <MSA300.h>
2+
#include <Wire.h>
3+
4+
acc_t data;
5+
MSA300 msa;
6+
7+
void setup() {
8+
// put your setup code here, to run once:
9+
Serial.begin(9600);
10+
Wire.begin();
11+
msa.begin();
12+
13+
14+
15+
}
16+
17+
void loop() {
18+
// put your main code here, to run repeatedly:
19+
data = msa.getAcceleration();
20+
Serial.print("Xa:");
21+
Serial.print(data.x);
22+
Serial.print("Ya:");
23+
Serial.print(data.y);
24+
Serial.print("Za:");
25+
Serial.println(data.z);
26+
delay(100);
27+
}

libraries/MSA300/keywords.txt

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#######################################
2+
# Syntax Coloring Map For Wire
3+
#######################################
4+
5+
#######################################
6+
# Datatypes (KEYWORD1)
7+
#######################################
8+
acc_t KEYWORD1
9+
orient_t KEYWORD1
10+
#######################################
11+
# Methods and Functions (KEYWORD2)
12+
#######################################
13+
14+
begin KEYWORD2
15+
getAcceleration KEYWORD2
16+
checkOrientation KEYWORD2
17+
18+
19+
#######################################
20+
# Instances (KEYWORD2)
21+
#######################################
22+
23+
MSA300 KEYWORD2
24+
25+
#######################################
26+
# Constants (LITERAL1)
27+
#######################################
28+
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name=MSA300
2+
version=1.0.0
3+
author=Bigbits
4+
maintainer=Bigbits<[email protected]>
5+
sentence= Arduino library for the MSA300 digital 14-bit accelerometer built into the Sipeed Maix Go.
6+
paragraph=Arduino library for the MSA300 digital 14-bit accelerometer built into the Sipeed Maix Go.
7+
category=Sensors
8+
url=http://www.sipeed.com
9+
architectures=k210

0 commit comments

Comments
 (0)