Dependancies
Pre-requisites
Buy the components
read-pin.ino
uint8_t battPin = 16; // Pin 16 on nRF52 Feather Adafruit
int isBattON = 0;
void setup() {
Serial.begin(115200);
pinMode(battPin, INPUT_PULLUP);
}
void loop() {
// Connect pin 16 to GND or 3V3
isBattON = digitalRead(battPin);
Serial.print("Batt status: ");
Serial.println(isBattON);
delay(2000);
}
.PHONY: lint compile upload clean
lint:
cpplint --extensions=ino --filter=-legal/copyright *.ino
compile:
arduino-cli compile --fqbn adafruit:nrf52:feather52832 ./
upload:
adafruit-nrfutil dfu genpkg --dev-type 0x0052 --application ./.*.hex dfu-package.zip
adafruit-nrfutil dfu serial --package dfu-package.zip -p /dev/tty.SLAB_USBtoUART -b 115200
clean:
rm -f .*.bin
rm -f .*.elf
rm -f .*.hex
rm -f *.zip
flash: lint compile upload clean
Read digital pin 16
of nRF52 Adafruit Feather board.