-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
57ce2b4
commit 7846f97
Showing
2 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Project Name | ||
TARGET = Trill | ||
|
||
# Sources | ||
CPP_SOURCES = Trill-Craft.cpp | ||
|
||
# Library Locations | ||
LIBDAISY_DIR = ../.. | ||
|
||
# Core location, and generic Makefile. | ||
SYSTEM_FILES_DIR = $(LIBDAISY_DIR)/core | ||
include $(SYSTEM_FILES_DIR)/Makefile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/** | ||
* Read Trill craft capacitive sensor | ||
*/ | ||
|
||
#include "daisy_seed.h" | ||
#include "dev/trill/Trill.h" | ||
|
||
using namespace daisy; | ||
|
||
DaisySeed hw; | ||
|
||
int main(void) | ||
{ | ||
// Initialize the Daisy Seed | ||
hw.Init(); | ||
|
||
// Start the Serial Logger | ||
hw.StartLog(); | ||
|
||
// Create a Trill object | ||
Trill trill; | ||
|
||
// Initialize the Trill object | ||
int i2cBus = 1; // only 1 and 4 are properly mapped to pins on the Seed | ||
int ret = trill.setup(i2cBus, Trill::CRAFT); | ||
if(ret) | ||
hw.PrintLine("trill.setup() returned %d", ret); | ||
|
||
// loop forever | ||
while(1) | ||
{ | ||
hw.DelayMs(100); | ||
trill.readI2C(); | ||
for(auto &x : trill.rawData) | ||
{ | ||
hw.Print("%d ", int(x*100000.f)); | ||
} | ||
hw.PrintLine(""); | ||
} | ||
return 0; | ||
} |