Skip to content

Commit

Permalink
update clue for new sensor
Browse files Browse the repository at this point in the history
  • Loading branch information
ladyada committed Dec 28, 2023
1 parent 24b2a97 commit 9e04237
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 34 deletions.
53 changes: 28 additions & 25 deletions .github/workflows/githubci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,15 @@ name: Arduino Library CI
on: [pull_request, push, repository_dispatch]

jobs:
build:
strategy:
fail-fast: false
matrix:
arduino-platform: ["pybadge", "pybadge_tinyusb", "pygamer", "pyportal",
"hallowing_m4", "hallowing_m0", "clue",
"monster_m4sk", "cpx_ada", "pyportal_titano"]

clang_and_doxy:
runs-on: ubuntu-latest

needs: build
steps:
- uses: actions/setup-python@v4
with:
python-version: '3.x'
- uses: actions/checkout@v3

- uses: actions/checkout@v3
with:
repository: adafruit/ci-arduino
Expand All @@ -26,23 +20,32 @@ jobs:
- name: pre-install
run: bash ci/actions_install.sh

# manually install WiFi
- name: extra libraries
run: |
git clone --quiet https://github.com/adafruit/WiFiNINA.git /home/runner/Arduino/libraries/WiFiNINA
- name: clang
run: python3 ci/run-clang-format.py -e "ci/*" -e "bin/*" -r .

- name: test platforms
run: python3 ci/build_platform.py ${{ matrix.arduino-platform }}
- name: doxygen
env:
GH_REPO_TOKEN: ${{ secrets.GH_REPO_TOKEN }}
PRETTYNAME : "Adafruit Arcada Library"
run: bash ci/doxy_gen_and_deploy.sh


build:
strategy:
fail-fast: false
matrix:
arduino-platform: ["pybadge", "pybadge_tinyusb", "pygamer", "pyportal",
"hallowing_m4", "hallowing_m0", "clue",
"monster_m4sk", "cpx_ada", "pyportal_titano"]

clang_and_doxy:
runs-on: ubuntu-latest
needs: build
needs: clang_and_doxy

steps:
- uses: actions/setup-python@v4
with:
python-version: '3.x'
- uses: actions/checkout@v3

- uses: actions/checkout@v3
with:
repository: adafruit/ci-arduino
Expand All @@ -51,12 +54,12 @@ jobs:
- name: pre-install
run: bash ci/actions_install.sh

- name: clang
run: python3 ci/run-clang-format.py -e "ci/*" -e "bin/*" -r .
# manually install WiFi
- name: extra libraries
run: |
git clone --quiet https://github.com/adafruit/WiFiNINA.git /home/runner/Arduino/libraries/WiFiNINA
- name: test platforms
run: python3 ci/build_platform.py ${{ matrix.arduino-platform }}

- name: doxygen
env:
GH_REPO_TOKEN: ${{ secrets.GH_REPO_TOKEN }}
PRETTYNAME : "Adafruit Arcada Library"
run: bash ci/doxy_gen_and_deploy.sh

3 changes: 3 additions & 0 deletions Adafruit_Arcada.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ class Adafruit_Arcada_SPITFT;
#ifndef ARCADA_TFT_LITE
#define ARCADA_TFT_LITE -1
#endif
#ifndef ARCADA_TFT_RST
#define ARCADA_TFT_RST -1
#endif
#ifndef ARCADA_LIGHT_SENSOR
#define ARCADA_LIGHT_SENSOR -1
#endif
Expand Down
1 change: 1 addition & 0 deletions Adafruit_Arcada_Def.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#ifndef _ADAFRUIT_ARCADA_DEFINES
#define _ADAFRUIT_ARCADA_DEFINES

#define ARCADA_BUTTONMASK_A 0x01
#define ARCADA_BUTTONMASK_B 0x02
#define ARCADA_BUTTONMASK_SELECT 0x04
Expand Down
4 changes: 2 additions & 2 deletions Adafruit_Arcada_InternalFlash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ uint32_t Adafruit_Arcada_SPITFT::availableFlash(void) {
}
}
return FLASH_SIZE - (uint32_t)flashAddress;
#else // !__SAMD51__
#else // !__SAMD51__
return 0; // unsupported chip
#endif // __SAMD51__
}
Expand Down Expand Up @@ -198,7 +198,7 @@ uint8_t *Adafruit_Arcada_SPITFT::writeDataToFlash(uint8_t *ramAddress,
// No need to align to next boundary, done at top of next call
flashAddress += len;
return returnVal;
#else // !__SAMD51__
#else // !__SAMD51__
return 0; // unsupported chip
#endif // __SAMD51__
}
Expand Down
4 changes: 4 additions & 0 deletions arcadatype.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@
#ifndef ARCADATYPE
#define ARCADATYPE

#include "Adafruit_Arcada_Def.h"
#include <Adafruit_GFX.h>
#include <Adafruit_ImageReader.h> // Image-reading functions
#include <Adafruit_NeoPixel.h>
#include <Adafruit_SPIFlash.h>
#include <Adafruit_WavePlayer.h>
#include <SdFat.h>
#include <TouchScreen.h>

#if defined(USE_TINYUSB)
#include "Adafruit_TinyUSB.h"
Expand Down
29 changes: 22 additions & 7 deletions examples/full_board_tests/arcada_clue_test/arcada_clue_test.ino
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include <Adafruit_SPIFlash.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_LSM6DS33.h>
#include <Adafruit_LSM6DS3TRC.h>
#include <Adafruit_LIS3MDL.h>
#include <Adafruit_SHT31.h>
#include <Adafruit_APDS9960.h>
Expand All @@ -11,7 +12,11 @@
#define WHITE_LED 43

Adafruit_Arcada arcada;

Adafruit_LSM6DS33 lsm6ds33;
Adafruit_LSM6DS3TRC lsm6ds3trc;
bool use_lsm6ds33 = false, use_lsm6ds3trc = false;

Adafruit_LIS3MDL lis3mdl;
Adafruit_SHT31 sht30;
Adafruit_APDS9960 apds9960;
Expand Down Expand Up @@ -114,15 +119,21 @@ void setup() {
}
arcada.display->print("APDS9960 ");

/********** Check LSM6DS33 */
if (!lsm6ds33.begin_I2C()) {
Serial.println("No LSM6DS33 found");
/********** Check LSM6DS3 or LSM6DS3TR-C */
if (lsm6ds33.begin_I2C()) {
use_lsm6ds33 = true;
} else if (lsm6ds3trc.begin_I2C()) {
use_lsm6ds3trc = true;
}

if (!use_lsm6ds3trc && !use_lsm6ds33) {
Serial.println("No LSM6DS3x found");
arcada.display->setTextColor(ARCADA_RED);
} else {
Serial.println("**LSM6DS33 OK!");
Serial.println("LSM6DS3x OK!");
arcada.display->setTextColor(ARCADA_GREEN);
}
arcada.display->println("LSM6DS33 ");
arcada.display->println("LSM6DS3x ");

/********** Check LIS3MDL */
if (!lis3mdl.begin_I2C()) {
Expand Down Expand Up @@ -190,7 +201,11 @@ void loop() {
arcada.display->println(" ");

sensors_event_t accel, gyro, mag, temp;
lsm6ds33.getEvent(&accel, &gyro, &temp);
if (use_lsm6ds33) {
lsm6ds33.getEvent(&accel, &gyro, &temp);
} else if (use_lsm6ds3trc) {
lsm6ds3trc.getEvent(&accel, &gyro, &temp);
}
lis3mdl.getEvent(&mag);
arcada.display->print("Accel:");
arcada.display->print(accel.acceleration.x, 1);
Expand Down Expand Up @@ -299,4 +314,4 @@ void onPDMdata() {

// 16-bit, 2 bytes per sample
samplesRead = bytesAvailable / 2;
}
}

0 comments on commit 9e04237

Please sign in to comment.