This file contains hidden or 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
uint8_t ReefwingLSM9DS1::whoAmIGyro() { | |
// Read WHO_AM_I register for LSM9DS1 accel/gyro | |
return readByte(LSM9DS1AG_ADDRESS, LSM9DS1AG_WHO_AM_I); | |
} | |
uint8_t ReefwingLSM9DS1::whoAmIMag() { | |
// Read WHO_AM_I register for LSM9DS1 magnetometer | |
return readByte(LSM9DS1M_ADDRESS, LSM9DS1M_WHO_AM_I); | |
} |
This file contains hidden or 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
#include <Arduino.h> | |
#include <U8g2lib.h> | |
#include <SPI.h> | |
/****************************************************************** | |
* Nano PIN MAPPING | |
******************************************************************/ | |
#define MOSI 11 | |
#define DC 1 |
This file contains hidden or 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
byte ReefwingLPS22HB::whoAmI() { | |
Wire1.beginTransmission(_address); | |
Wire1.write(LPS22HB_WHO_AM_I); | |
Wire1.endTransmission(); | |
Wire1.requestFrom(_address, 1); | |
return Wire1.read(); | |
} | |
bool ReefwingLPS22HB::connected() { | |
return (whoAmI() == LPS22HB_WHO_AM_I_VALUE); |
This file contains hidden or 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
#include <Wire.h> | |
#define HTS221_ADDRESS 0x5F // Nano 33 BLE Sense Rev 1 Sensor | |
#define HS3003_ADDRESS 0x44 // Nano 33 BLE Sense Rev 2 Sensor | |
enum BoardType { | |
NANO33BLE, | |
NANO33BLE_SENSE, | |
NANO33BLE_SENSE_R2, | |
XIAO_SENSE, |
This file contains hidden or 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
void setup() { | |
// Start Serial and wait for connection | |
Serial.begin(115200); | |
while (!Serial); | |
Serial.println(BOARD_NAME); | |
} |
This file contains hidden or 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
#if defined(ARDUINO_ARCH_NRF52840) | |
#include "nano33ble.h" | |
#elif defined(ARDUINO_PORTENTA_H7_M7) | |
#include "portentah7.h" | |
#elif defined(ARDUINO_ARCH_MBED_RP2040) | |
#include "pico.h" | |
#else | |
#error "Unsupported Hardware" | |
#endif // target detection |
This file contains hidden or 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
1. float pot = (((float)analogRead(VPOT) + 0.5) / 1024.0) * 100.0; | |
2. | |
3. itoa((int)pot, throttleAsChar, DECIMAL); // itoa = Int to ASCII | |
4. u8x8.drawString(1, 4, "THROTTLE: "); | |
5. u8x8.drawString(10, 4, throttleAsChar); | |
6. u8x8.drawString(14, 4, "%"); |
This file contains hidden or 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
uint32_t wday = 0; // Sunday | |
uint8_t hh, mm, ss, mmonth, dday; // H, M, S, month & day variables | |
uint16_t yyear; // Year is 16 bit int | |
char const* WEEKDAYS[] = {"SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"}; | |
void displayTime(boolean fullUpdate) { | |
int batSOC = ttgo->power->getBattPercentage(); | |
int temp = ttgo->power->getTemp(); |