diff --git a/examples/NonArduino/Raspberry/PiHal.h b/examples/NonArduino/Raspberry/PiHal.h index 83991f78..5a94fe8d 100644 --- a/examples/NonArduino/Raspberry/PiHal.h +++ b/examples/NonArduino/Raspberry/PiHal.h @@ -107,17 +107,17 @@ class PiHal : public RadioLibHal { return(0); } - gpioSetMode(pin, PI_INPUT); - uint32_t start = gpioTick(); - uint32_t curtick = gpioTick(); + this->pinMode(pin, PI_INPUT); + uint32_t start = this->micros(); + uint32_t curtick = this->micros(); - while(gpioRead(pin) == state) { - if((gpioTick() - curtick) > timeout) { + while(this->digitalRead(pin) == state) { + if((this->micros() - curtick) > timeout) { return(0); } } - return(gpioTick() - start); + return(this->micros() - start); } void spiBegin() { diff --git a/examples/NonArduino/Raspberry/main.cpp b/examples/NonArduino/Raspberry/main.cpp index 5e57c983..54ae3850 100644 --- a/examples/NonArduino/Raspberry/main.cpp +++ b/examples/NonArduino/Raspberry/main.cpp @@ -29,8 +29,8 @@ PiHal* hal = new PiHal(1); // NSS pin: 7 // DIO1 pin: 17 // NRST pin: 22 -// BUSY pin: 4 -SX1261 radio = new Module(hal, 7, 17, 22, 4); +// BUSY pin: not connected +SX1261 radio = new Module(hal, 7, 17, 22, RADIOLIB_NC); // the entry point for the program int main(int argc, char** argv) { @@ -50,7 +50,7 @@ int main(int argc, char** argv) { state = radio.transmit("Hello World!"); if(state == RADIOLIB_ERR_NONE) { // the packet was successfully transmitted - printf("success!"); + printf("success!\n"); // wait for a second before transmitting again hal->delay(1000);