CubeCell - issues with ultrasonic sensor

Hello everyone

I am trying to get familiar with the new CubeCell board and have some issues to do so.
I have tried to get an ultrasonic sensor working, but failed by using the “pulseIn” function. So i have tried to setup an interrupt pin and got the pin (GPIO3) connected to the “echo” pin of the ultrasonic sensor, but the “attachInterrupt” function also doesnt work.

I allways get the error message “… was not declared in this scope”

Any suggestions how i could get the ultrasonic sensor work correctly?

got the attachInterrupt working. Found the right example in “Factory_Test_AM01”

pinMode(GPIO1, INPUT);
attachInterrupt(GPIO1, interruptHandler1, RISING);

It is a bit like talking to my self in this thread, but i have to ask this last one question …

if i use the esp32 or a arduino board i am able to use “micros()” but with the CubeCell it dont work. i am trying to catch the runtime of the ultrasonic.
“millis()” works fine but the resolution is to low for ultrasonic measurements :slight_smile:
Is there Anyone who got an ultrasonic sensor works with the cubecell?

@ vino2300,

please confirm what ultrasonic sensor you are testing?

May want to duplicate your test



Hello Gipsyblues

It is the common HC-SR04 sensor.
I need to know how to use “micros()” with the new cubecell.
“millis()” works fine but ultrasonic travels 34cm in 1ms therefore it is a bit too coarse.

thanks a lot for your help!


my apologies for the delay.

I had ordered samples of bothe capsules and boards earlier and I was hoping to have received the shipment by now.

Unfortunately my order is still not here. I suspect the capsule version may be holding things back.

Will revisit the topic once my shipment gets here




i have took a look in the “ASR_Arduino.h” library located in the cubecell core.
In there are all commands like “pinMode()”, “delay()”, “delayMicroseconds()”, “millis()” and so on are declared, but there is no “micros()” or “pulseIn()”.
Is it possible to add this commands by my own? Is there something i should take care of? which librarys i have to modify additionally?

I have not tried the HC-SR04 using the CubeCell, but I have used this library on other Arduinos

However, talking of millis(), have you tried using the LoRaWan example ?
There the millis() stops counting, just wondering why…