Library suitable for Raspberry Pi Pico. #1

Closed
opened 2023-01-28 15:43:30 +00:00 by kuckyder2te · 19 comments
kuckyder2te commented 2023-01-28 15:43:30 +00:00 (Migrated from github.com)

Hey,
I'm trying to include your library in my project. The PlatformIO catalog states that the library can also be used for Raspberry Pi Pico. Is that correct? I have problems there. I tried the simple_async-ino example
Thanks

Hey, I'm trying to include your library in my project. The PlatformIO catalog states that the library can also be used for Raspberry Pi Pico. Is that correct? I have problems there. I tried the simple_async-ino example Thanks
bjoernboeckle commented 2023-01-29 13:25:35 +00:00 (Migrated from github.com)

Hey,
Actually I never tried it with an Pico, but I don't see a reason why it shouldn't work.
Could you explain a little bit more why it doesn't work, or what kind of problems you see?
Are you able to compile?
Is the synchron version "simble.ino" working?

Couly you also let me know how the sensor is connected (which pins etc.)?

Hey, Actually I never tried it with an Pico, but I don't see a reason why it shouldn't work. Could you explain a little bit more why it doesn't work, or what kind of problems you see? Are you able to compile? Is the synchron version "simble.ino" working? Couly you also let me know how the sensor is connected (which pins etc.)?
kuckyder2te commented 2023-01-30 12:58:35 +00:00 (Migrated from github.com)

Hey, thanks for your quick reply and your interest.
I can compile the code. But the result is 0.
[image: image.png]
sensor.isFinished is probably true

Am So., 29. Jan. 2023 um 14:25 Uhr schrieb bjoernboeckle <
@.***>:

Hey,
Actually I never tried it with an Pico, but I don't see a reason why it
shouldn't work.
Could you explain a little bit more why it doesn't work, or what kind of
problems you see?
Are you able to compile?
Is the synchron version "simble.ino" working?


Reply to this email directly, view it on GitHub
https://github.com/bjoernboeckle/HC_SR04/issues/1#issuecomment-1407663386,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AA5HKW3ZLQMXFPKHXGYQDGLWUZVVVANCNFSM6AAAAAAUJWS6PM
.
You are receiving this because you authored the thread.Message ID:
@.***>

--
Mit freundlichen Grüßen
Wilhelm Kuckelsberg

Hey, thanks for your quick reply and your interest. I can compile the code. But the result is 0. [image: image.png] sensor.isFinished is probably true Am So., 29. Jan. 2023 um 14:25 Uhr schrieb bjoernboeckle < ***@***.***>: > Hey, > Actually I never tried it with an Pico, but I don't see a reason why it > shouldn't work. > Could you explain a little bit more why it doesn't work, or what kind of > problems you see? > Are you able to compile? > Is the synchron version "simble.ino" working? > > — > Reply to this email directly, view it on GitHub > <https://github.com/bjoernboeckle/HC_SR04/issues/1#issuecomment-1407663386>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/AA5HKW3ZLQMXFPKHXGYQDGLWUZVVVANCNFSM6AAAAAAUJWS6PM> > . > You are receiving this because you authored the thread.Message ID: > ***@***.***> > -- Mit freundlichen Grüßen Wilhelm Kuckelsberg
kuckyder2te commented 2023-01-30 13:02:56 +00:00 (Migrated from github.com)

The example "simple.ino" returns only 0.

Am Mo., 30. Jan. 2023 um 13:57 Uhr schrieb Wilhelm Kuckelsberg <
@.***>:

Hey, thanks for your quick reply and your interest.
I can compile the code. But the result is 0.
[image: image.png]
sensor.isFinished is probably true

Am So., 29. Jan. 2023 um 14:25 Uhr schrieb bjoernboeckle <
@.***>:

Hey,
Actually I never tried it with an Pico, but I don't see a reason why it
shouldn't work.
Could you explain a little bit more why it doesn't work, or what kind of
problems you see?
Are you able to compile?
Is the synchron version "simble.ino" working?


Reply to this email directly, view it on GitHub
https://github.com/bjoernboeckle/HC_SR04/issues/1#issuecomment-1407663386,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AA5HKW3ZLQMXFPKHXGYQDGLWUZVVVANCNFSM6AAAAAAUJWS6PM
.
You are receiving this because you authored the thread.Message ID:
@.***>

--
Mit freundlichen Grüßen
Wilhelm Kuckelsberg

--
Mit freundlichen Grüßen
Wilhelm Kuckelsberg

The example "simple.ino" returns only 0. Am Mo., 30. Jan. 2023 um 13:57 Uhr schrieb Wilhelm Kuckelsberg < ***@***.***>: > Hey, thanks for your quick reply and your interest. > I can compile the code. But the result is 0. > [image: image.png] > sensor.isFinished is probably true > > Am So., 29. Jan. 2023 um 14:25 Uhr schrieb bjoernboeckle < > ***@***.***>: > >> Hey, >> Actually I never tried it with an Pico, but I don't see a reason why it >> shouldn't work. >> Could you explain a little bit more why it doesn't work, or what kind of >> problems you see? >> Are you able to compile? >> Is the synchron version "simble.ino" working? >> >> — >> Reply to this email directly, view it on GitHub >> <https://github.com/bjoernboeckle/HC_SR04/issues/1#issuecomment-1407663386>, >> or unsubscribe >> <https://github.com/notifications/unsubscribe-auth/AA5HKW3ZLQMXFPKHXGYQDGLWUZVVVANCNFSM6AAAAAAUJWS6PM> >> . >> You are receiving this because you authored the thread.Message ID: >> ***@***.***> >> > > > -- > Mit freundlichen Grüßen > Wilhelm Kuckelsberg > -- Mit freundlichen Grüßen Wilhelm Kuckelsberg
kuckyder2te commented 2023-01-30 13:30:08 +00:00 (Migrated from github.com)

[image: image.png]

Am Mo., 30. Jan. 2023 um 14:02 Uhr schrieb Wilhelm Kuckelsberg <
@.***>:

The example "simple.ino" returns only 0.

Am Mo., 30. Jan. 2023 um 13:57 Uhr schrieb Wilhelm Kuckelsberg <
@.***>:

Hey, thanks for your quick reply and your interest.
I can compile the code. But the result is 0.
[image: image.png]
sensor.isFinished is probably true

Am So., 29. Jan. 2023 um 14:25 Uhr schrieb bjoernboeckle <
@.***>:

Hey,
Actually I never tried it with an Pico, but I don't see a reason why it
shouldn't work.
Could you explain a little bit more why it doesn't work, or what kind of
problems you see?
Are you able to compile?
Is the synchron version "simble.ino" working?


Reply to this email directly, view it on GitHub
https://github.com/bjoernboeckle/HC_SR04/issues/1#issuecomment-1407663386,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AA5HKW3ZLQMXFPKHXGYQDGLWUZVVVANCNFSM6AAAAAAUJWS6PM
.
You are receiving this because you authored the thread.Message ID:
@.***>

--
Mit freundlichen Grüßen
Wilhelm Kuckelsberg

--
Mit freundlichen Grüßen
Wilhelm Kuckelsberg

--
Mit freundlichen Grüßen
Wilhelm Kuckelsberg

[image: image.png] Am Mo., 30. Jan. 2023 um 14:02 Uhr schrieb Wilhelm Kuckelsberg < ***@***.***>: > The example "simple.ino" returns only 0. > > Am Mo., 30. Jan. 2023 um 13:57 Uhr schrieb Wilhelm Kuckelsberg < > ***@***.***>: > >> Hey, thanks for your quick reply and your interest. >> I can compile the code. But the result is 0. >> [image: image.png] >> sensor.isFinished is probably true >> >> Am So., 29. Jan. 2023 um 14:25 Uhr schrieb bjoernboeckle < >> ***@***.***>: >> >>> Hey, >>> Actually I never tried it with an Pico, but I don't see a reason why it >>> shouldn't work. >>> Could you explain a little bit more why it doesn't work, or what kind of >>> problems you see? >>> Are you able to compile? >>> Is the synchron version "simble.ino" working? >>> >>> — >>> Reply to this email directly, view it on GitHub >>> <https://github.com/bjoernboeckle/HC_SR04/issues/1#issuecomment-1407663386>, >>> or unsubscribe >>> <https://github.com/notifications/unsubscribe-auth/AA5HKW3ZLQMXFPKHXGYQDGLWUZVVVANCNFSM6AAAAAAUJWS6PM> >>> . >>> You are receiving this because you authored the thread.Message ID: >>> ***@***.***> >>> >> >> >> -- >> Mit freundlichen Grüßen >> Wilhelm Kuckelsberg >> > > > -- > Mit freundlichen Grüßen > Wilhelm Kuckelsberg > -- Mit freundlichen Grüßen Wilhelm Kuckelsberg
bjoernboeckle commented 2023-01-30 13:47:12 +00:00 (Migrated from github.com)

Could you provide some information how its wired?
Could also be an electrical issue.

Could you provide some information how its wired? Could also be an electrical issue.
kuckyder2te commented 2023-01-30 16:38:26 +00:00 (Migrated from github.com)

I'm a bit unsure now. Your library works fine on an Arduino MEGA2560.
The picture shows my circuit board (self-made).
[image: IMG_0228.JPG]
I also tried using a different library. Also no success.
I checked the wiring several times.
Trigger on PIN 29
Echo PIN 27
The Pico and the sensor are supplied with a 5V source.

The purple brick is an IMU. The whole thing is supposed to be a control for
a drone.
I need an interrupt, otherwise the IMU will not work properly.

Am Mo., 30. Jan. 2023 um 14:47 Uhr schrieb bjoernboeckle <
@.***>:

Could you provide some information how its wired?
Could also be an electrical issue.


Reply to this email directly, view it on GitHub
https://github.com/bjoernboeckle/HC_SR04/issues/1#issuecomment-1408659404,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AA5HKWYFPI7NDP3JGKOMQS3WU7A6VANCNFSM6AAAAAAUJWS6PM
.
You are receiving this because you authored the thread.Message ID:
@.***>

--
Mit freundlichen Grüßen
Wilhelm Kuckelsberg

I'm a bit unsure now. Your library works fine on an Arduino MEGA2560. The picture shows my circuit board (self-made). [image: IMG_0228.JPG] I also tried using a different library. Also no success. I checked the wiring several times. Trigger on PIN 29 Echo PIN 27 The Pico and the sensor are supplied with a 5V source. The purple brick is an IMU. The whole thing is supposed to be a control for a drone. I need an interrupt, otherwise the IMU will not work properly. Am Mo., 30. Jan. 2023 um 14:47 Uhr schrieb bjoernboeckle < ***@***.***>: > Could you provide some information how its wired? > Could also be an electrical issue. > > — > Reply to this email directly, view it on GitHub > <https://github.com/bjoernboeckle/HC_SR04/issues/1#issuecomment-1408659404>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/AA5HKWYFPI7NDP3JGKOMQS3WU7A6VANCNFSM6AAAAAAUJWS6PM> > . > You are receiving this because you authored the thread.Message ID: > ***@***.***> > -- Mit freundlichen Grüßen Wilhelm Kuckelsberg
bjoernboeckle commented 2023-01-31 08:55:46 +00:00 (Migrated from github.com)

Unfortunately, I cannot see the image (i just see: [image: IMG_0228.JPG]).
Is it available in your github repository?

I suppose Pin 29 means the pin number on the board, not the GPIO number (which would be 22, while Pin 27 means GPIO 21)?
Is this correct?

Is it possible for you to measure the pins using an oscilloscope?
Without any idea I could imagine that this could be related to the 3.3V which is used by the Pico, while the sensor is using 5V.
How are you powering the sensor and the pico (as mentioned I cannot see your image)?
I’m doing the same with an ESP32 which is also at 3.3V which works fine, but it’s probably not the 100% perfect solution :-) .

Unfortunately, I cannot see the image (i just see: [image: IMG_0228.JPG]). Is it available in your github repository? I suppose Pin 29 means the pin number on the board, not the GPIO number (which would be 22, while Pin 27 means GPIO 21)? Is this correct? Is it possible for you to measure the pins using an oscilloscope? Without any idea I could imagine that this could be related to the 3.3V which is used by the Pico, while the sensor is using 5V. How are you powering the sensor and the pico (as mentioned I cannot see your image)? I’m doing the same with an ESP32 which is also at 3.3V which works fine, but it’s probably not the 100% perfect solution :-) .
kuckyder2te commented 2023-01-31 11:09:50 +00:00 (Migrated from github.com)

Is it available in your github repository? - No

I suppose Pin 29 means the pin number on the board, not the GPIO number
(which would be 22, while Pin 27 means GPIO 21)?
Is this correct? - No 😕 I Idiot, I corrected that, no success.

Is it possible for you to measure the pins using an oscilloscope? - I have
little experience but will try. A friend can help me with this. But only on
weekend.

Unfortunately, I cannot see the image - The pico and HCSR04 with 5V at VSYS.
Can a level shifter be the solution?

Can you see the image now?

Am Di., 31. Jan. 2023 um 09:55 Uhr schrieb bjoernboeckle <
@.***>:

Unfortunately, I cannot see the image (i just see: [image: IMG_0228.JPG]).
Is it available in your github repository?

I suppose Pin 29 means the pin number on the board, not the GPIO number
(which would be 22, while Pin 27 means GPIO 21)?
Is this correct?

Is it possible for you to measure the pins using an oscilloscope?
Without any idea I could imagine that this could be related to the 3.3V
which is used by the Pico, while the sensor is using 5V.
How are you powering the sensor and the pico (as mentioned I cannot see
your image)?
I’m doing the same with an ESP32 which is also at 3.3V which works fine,
but it’s probably not the 100% perfect solution :-) .


Reply to this email directly, view it on GitHub
https://github.com/bjoernboeckle/HC_SR04/issues/1#issuecomment-1409984836,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AA5HKW7EWZHPWJUYI42XGGTWVDHRZANCNFSM6AAAAAAUJWS6PM
.
You are receiving this because you authored the thread.Message ID:
@.***>

--
Mit freundlichen Grüßen
Wilhelm Kuckelsberg

Is it available in your github repository? - No I suppose Pin 29 means the pin number on the board, not the GPIO number (which would be 22, while Pin 27 means GPIO 21)? Is this correct? - No 😕 I Idiot, I corrected that, no success. Is it possible for you to measure the pins using an oscilloscope? - I have little experience but will try. A friend can help me with this. But only on weekend. Unfortunately, I cannot see the image - The pico and HCSR04 with 5V at VSYS. Can a level shifter be the solution? Can you see the image now? Am Di., 31. Jan. 2023 um 09:55 Uhr schrieb bjoernboeckle < ***@***.***>: > Unfortunately, I cannot see the image (i just see: [image: IMG_0228.JPG]). > Is it available in your github repository? > > I suppose Pin 29 means the pin number on the board, not the GPIO number > (which would be 22, while Pin 27 means GPIO 21)? > Is this correct? > > Is it possible for you to measure the pins using an oscilloscope? > Without any idea I could imagine that this could be related to the 3.3V > which is used by the Pico, while the sensor is using 5V. > How are you powering the sensor and the pico (as mentioned I cannot see > your image)? > I’m doing the same with an ESP32 which is also at 3.3V which works fine, > but it’s probably not the 100% perfect solution :-) . > > — > Reply to this email directly, view it on GitHub > <https://github.com/bjoernboeckle/HC_SR04/issues/1#issuecomment-1409984836>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/AA5HKW7EWZHPWJUYI42XGGTWVDHRZANCNFSM6AAAAAAUJWS6PM> > . > You are receiving this because you authored the thread.Message ID: > ***@***.***> > -- Mit freundlichen Grüßen Wilhelm Kuckelsberg
bjoernboeckle commented 2023-01-31 12:19:05 +00:00 (Migrated from github.com)

Can you see the image now?
Unfortunately not, maybe a security setting, but I think its fine, VSYS 5V for pico and sensor, GPIO 22 for Trigger and GPIO21 for Echo, and of course GND is also connected?
Should be fine.

Can a level shifter be the solution?
In case the issue is really related to the 3.3V and 5V difference on the IO's, then yes.
But it should also work without. 5V on the 3.3V shouldn't damage the Pico, and 3.3V for the trigger should be ok for the HC-SR04.
Maybe an electrical experts starts to throw stones at me saying that, but from my experience it should be ok.

But since the synchron version is also not working (which should really not depend on the controller, interrupts etc.) then thats still the only reason I see.
Could be a small issue in wiring, using wrong IO numbers, or the 5V/3.3V problem.
Using google seems most people are using a HC-SR04+ with the pico which runs at 3.3V.
Or a voltage divider with the orignal 5V HC-SR04.

_**Can you see the image now?**_ Unfortunately not, maybe a security setting, but I think its fine, VSYS 5V for pico and sensor, GPIO 22 for Trigger and GPIO21 for Echo, and of course GND is also connected? Should be fine. _**Can a level shifter be the solution?**_ In case the issue is really related to the 3.3V and 5V difference on the IO's, then yes. But it should also work without. 5V on the 3.3V shouldn't damage the Pico, and 3.3V for the trigger should be ok for the HC-SR04. Maybe an electrical experts starts to throw stones at me saying that, but from my experience it should be ok. But since the synchron version is also not working (which should really not depend on the controller, interrupts etc.) then thats still the only reason I see. Could be a small issue in wiring, using wrong IO numbers, or the 5V/3.3V problem. Using google seems most people are using a HC-SR04+ with the pico which runs at 3.3V. Or a voltage divider with the orignal 5V HC-SR04.
kuckyder2te commented 2023-01-31 18:59:37 +00:00 (Migrated from github.com)

Hallo, habe es jetzt mit einem Level Shifter probiert. Kein Erfolg. Am
Wochenende kommt ein Freund zu mir, der hat Erfahrung mit einem
Oszilloskop.
Werde mich auch weiter im Netz umschauen. Es muss ja an der Pico liegen.
Ich danke Dir vielmals für Deine Geduld. Werde mich melden wenn ich weiter
gekommen bin.
Die Verkabelung ist OK, habe mir eine richtige Platine geätzt. Schade, dass
Du die Bilder nicht sehen kannst, werde mir aber zum Wochenende ein GIT
anlegen.

Am Di., 31. Jan. 2023 um 13:19 Uhr schrieb bjoernboeckle <
@.***>:

Can you see the image now?
Unfortunately not, maybe a security setting, but I think its fine, VSYS 5V
for pico and sensor, GPIO 22 for Trigger and GPIO21 for Echo, and of course
GND is also connected?
Should be fine.

Can a level shifter be the solution?
In case the issue is really related to the 3.3V and 5V difference on the
IO's, then yes.
But it should also work without. 5V on the 3.3V shouldn't damage the Pico,
and 3.3V for the trigger should be ok for the HC-SR04.
Maybe an electrical experts starts to throw stones at me saying that, but
from my experience it should be ok.

But since the synchron version is also not working (which should really
not depend on the controller, interrupts etc.) then thats still the only
reason I see.
Could be a small issue in wiring, using wrong IO numbers, or the 5V/3.3V
problem.
Using google seems most people are using a HC-SR04+ with the pico which
runs at 3.3V.
Or a voltage divider with the orignal 5V HC-SR04.


Reply to this email directly, view it on GitHub
https://github.com/bjoernboeckle/HC_SR04/issues/1#issuecomment-1410250059,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AA5HKW6OHORTWI5DVQSCJ2DWVD7MHANCNFSM6AAAAAAUJWS6PM
.
You are receiving this because you authored the thread.Message ID:
@.***>

--
Mit freundlichen Grüßen
Wilhelm Kuckelsberg

Hallo, habe es jetzt mit einem Level Shifter probiert. Kein Erfolg. Am Wochenende kommt ein Freund zu mir, der hat Erfahrung mit einem Oszilloskop. Werde mich auch weiter im Netz umschauen. Es muss ja an der Pico liegen. Ich danke Dir vielmals für Deine Geduld. Werde mich melden wenn ich weiter gekommen bin. Die Verkabelung ist OK, habe mir eine richtige Platine geätzt. Schade, dass Du die Bilder nicht sehen kannst, werde mir aber zum Wochenende ein GIT anlegen. Am Di., 31. Jan. 2023 um 13:19 Uhr schrieb bjoernboeckle < ***@***.***>: > *Can you see the image now?* > Unfortunately not, maybe a security setting, but I think its fine, VSYS 5V > for pico and sensor, GPIO 22 for Trigger and GPIO21 for Echo, and of course > GND is also connected? > Should be fine. > > *Can a level shifter be the solution?* > In case the issue is really related to the 3.3V and 5V difference on the > IO's, then yes. > But it should also work without. 5V on the 3.3V shouldn't damage the Pico, > and 3.3V for the trigger should be ok for the HC-SR04. > Maybe an electrical experts starts to throw stones at me saying that, but > from my experience it should be ok. > > But since the synchron version is also not working (which should really > not depend on the controller, interrupts etc.) then thats still the only > reason I see. > Could be a small issue in wiring, using wrong IO numbers, or the 5V/3.3V > problem. > Using google seems most people are using a HC-SR04+ with the pico which > runs at 3.3V. > Or a voltage divider with the orignal 5V HC-SR04. > > — > Reply to this email directly, view it on GitHub > <https://github.com/bjoernboeckle/HC_SR04/issues/1#issuecomment-1410250059>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/AA5HKW6OHORTWI5DVQSCJ2DWVD7MHANCNFSM6AAAAAAUJWS6PM> > . > You are receiving this because you authored the thread.Message ID: > ***@***.***> > -- Mit freundlichen Grüßen Wilhelm Kuckelsberg
kuckyder2te commented 2023-02-01 17:56:11 +00:00 (Migrated from github.com)

It's me again. It works. I used your lib again with the mega2560. The
following occurred to me.
If I display the interrupt pin in line 102 (HC_SR04.h), 5 is output. But I
took PIN18 as ECHO_PIN. The same with ECHO_PIN 2. Now interrupt 0 is
displayed.

Can we talk in german?

Am Di., 31. Jan. 2023 um 19:58 Uhr schrieb Wilhelm Kuckelsberg <
@.***>:

Hallo, habe es jetzt mit einem Level Shifter probiert. Kein Erfolg. Am
Wochenende kommt ein Freund zu mir, der hat Erfahrung mit einem
Oszilloskop.
Werde mich auch weiter im Netz umschauen. Es muss ja an der Pico liegen.
Ich danke Dir vielmals für Deine Geduld. Werde mich melden wenn ich weiter
gekommen bin.
Die Verkabelung ist OK, habe mir eine richtige Platine geätzt. Schade,
dass Du die Bilder nicht sehen kannst, werde mir aber zum Wochenende ein
GIT anlegen.

Am Di., 31. Jan. 2023 um 13:19 Uhr schrieb bjoernboeckle <
@.***>:

Can you see the image now?
Unfortunately not, maybe a security setting, but I think its fine, VSYS
5V for pico and sensor, GPIO 22 for Trigger and GPIO21 for Echo, and of
course GND is also connected?
Should be fine.

Can a level shifter be the solution?
In case the issue is really related to the 3.3V and 5V difference on the
IO's, then yes.
But it should also work without. 5V on the 3.3V shouldn't damage the
Pico, and 3.3V for the trigger should be ok for the HC-SR04.
Maybe an electrical experts starts to throw stones at me saying that, but
from my experience it should be ok.

But since the synchron version is also not working (which should really
not depend on the controller, interrupts etc.) then thats still the only
reason I see.
Could be a small issue in wiring, using wrong IO numbers, or the 5V/3.3V
problem.
Using google seems most people are using a HC-SR04+ with the pico which
runs at 3.3V.
Or a voltage divider with the orignal 5V HC-SR04.


Reply to this email directly, view it on GitHub
https://github.com/bjoernboeckle/HC_SR04/issues/1#issuecomment-1410250059,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AA5HKW6OHORTWI5DVQSCJ2DWVD7MHANCNFSM6AAAAAAUJWS6PM
.
You are receiving this because you authored the thread.Message ID:
@.***>

--
Mit freundlichen Grüßen
Wilhelm Kuckelsberg

--
Mit freundlichen Grüßen
Wilhelm Kuckelsberg

It's me again. It works. I used your lib again with the mega2560. The following occurred to me. If I display the interrupt pin in line 102 (HC_SR04.h), 5 is output. But I took PIN18 as ECHO_PIN. The same with ECHO_PIN 2. Now interrupt 0 is displayed. Can we talk in german? Am Di., 31. Jan. 2023 um 19:58 Uhr schrieb Wilhelm Kuckelsberg < ***@***.***>: > Hallo, habe es jetzt mit einem Level Shifter probiert. Kein Erfolg. Am > Wochenende kommt ein Freund zu mir, der hat Erfahrung mit einem > Oszilloskop. > Werde mich auch weiter im Netz umschauen. Es muss ja an der Pico liegen. > Ich danke Dir vielmals für Deine Geduld. Werde mich melden wenn ich weiter > gekommen bin. > Die Verkabelung ist OK, habe mir eine richtige Platine geätzt. Schade, > dass Du die Bilder nicht sehen kannst, werde mir aber zum Wochenende ein > GIT anlegen. > > Am Di., 31. Jan. 2023 um 13:19 Uhr schrieb bjoernboeckle < > ***@***.***>: > >> *Can you see the image now?* >> Unfortunately not, maybe a security setting, but I think its fine, VSYS >> 5V for pico and sensor, GPIO 22 for Trigger and GPIO21 for Echo, and of >> course GND is also connected? >> Should be fine. >> >> *Can a level shifter be the solution?* >> In case the issue is really related to the 3.3V and 5V difference on the >> IO's, then yes. >> But it should also work without. 5V on the 3.3V shouldn't damage the >> Pico, and 3.3V for the trigger should be ok for the HC-SR04. >> Maybe an electrical experts starts to throw stones at me saying that, but >> from my experience it should be ok. >> >> But since the synchron version is also not working (which should really >> not depend on the controller, interrupts etc.) then thats still the only >> reason I see. >> Could be a small issue in wiring, using wrong IO numbers, or the 5V/3.3V >> problem. >> Using google seems most people are using a HC-SR04+ with the pico which >> runs at 3.3V. >> Or a voltage divider with the orignal 5V HC-SR04. >> >> — >> Reply to this email directly, view it on GitHub >> <https://github.com/bjoernboeckle/HC_SR04/issues/1#issuecomment-1410250059>, >> or unsubscribe >> <https://github.com/notifications/unsubscribe-auth/AA5HKW6OHORTWI5DVQSCJ2DWVD7MHANCNFSM6AAAAAAUJWS6PM> >> . >> You are receiving this because you authored the thread.Message ID: >> ***@***.***> >> > > > -- > Mit freundlichen Grüßen > Wilhelm Kuckelsberg > -- Mit freundlichen Grüßen Wilhelm Kuckelsberg
bjoernboeckle commented 2023-02-02 09:41:10 +00:00 (Migrated from github.com)

Ja deutsch ist kein Problem, denke nur englisch wäre besser, falls jemand anderes ein ähnliches Problem hat und den Verlauf lesen will.
In Zeile 102 steht bei mir nur :"}"
Intern verwende ich die Funktion: "digitalPinToInterrupt(_echo);"
Dann ist es eventuell doch ein Problem mit den Interrupts beim Pico....

Aber Du hattest doch gemeint, das die "Simple" Version auch nicht funktioniert?
Die verwendet keine Interrupts.

Funktioniert es jetzt bei Dir? Und falls ja was hast Du geändert?

Ja deutsch ist kein Problem, denke nur englisch wäre besser, falls jemand anderes ein ähnliches Problem hat und den Verlauf lesen will. In Zeile 102 steht bei mir nur :"}" Intern verwende ich die Funktion: "digitalPinToInterrupt(_echo);" Dann ist es eventuell doch ein Problem mit den Interrupts beim Pico.... Aber Du hattest doch gemeint, das die "Simple" Version auch nicht funktioniert? Die verwendet keine Interrupts. Funktioniert es jetzt bei Dir? Und falls ja was hast Du geändert?
kuckyder2te commented 2023-02-02 14:40:51 +00:00 (Migrated from github.com)

I will set up a GIT tomorrow. Then I can better describe the problem with
pictures. Both simple and simple_async work on the Arduino. Not on the
Pico. I'll send you a code snippet later.

Am Do., 2. Feb. 2023 um 10:41 Uhr schrieb bjoernboeckle <
@.***>:

Ja deutsch ist kein Problem, denke nur englisch wäre besser, falls jemand
anderes ein ähnliches Problem hat und den Verlauf lesen will.
In Zeile 102 steht bei mir nur :"}"
Intern verwende ich die Funktion: "digitalPinToInterrupt(_echo);"
Dann ist es eventuell doch ein Problem mit den Interrupts beim Pico....

Aber Du hattest doch gemeint, das die "Simple" Version auch nicht
funktioniert?
Die verwendet keine Interrupts.

Funktioniert es jetzt bei Dir? Und falls ja was hast Du geändert?


Reply to this email directly, view it on GitHub
https://github.com/bjoernboeckle/HC_SR04/issues/1#issuecomment-1413427998,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AA5HKW6KVKPGR7FIPFBC72TWVN6MDANCNFSM6AAAAAAUJWS6PM
.
You are receiving this because you authored the thread.Message ID:
@.***>

--
Mit freundlichen Grüßen
Wilhelm Kuckelsberg

I will set up a GIT tomorrow. Then I can better describe the problem with pictures. Both simple and simple_async work on the Arduino. Not on the Pico. I'll send you a code snippet later. Am Do., 2. Feb. 2023 um 10:41 Uhr schrieb bjoernboeckle < ***@***.***>: > Ja deutsch ist kein Problem, denke nur englisch wäre besser, falls jemand > anderes ein ähnliches Problem hat und den Verlauf lesen will. > In Zeile 102 steht bei mir nur :"}" > Intern verwende ich die Funktion: "digitalPinToInterrupt(_echo);" > Dann ist es eventuell doch ein Problem mit den Interrupts beim Pico.... > > Aber Du hattest doch gemeint, das die "Simple" Version auch nicht > funktioniert? > Die verwendet keine Interrupts. > > Funktioniert es jetzt bei Dir? Und falls ja was hast Du geändert? > > — > Reply to this email directly, view it on GitHub > <https://github.com/bjoernboeckle/HC_SR04/issues/1#issuecomment-1413427998>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/AA5HKW6KVKPGR7FIPFBC72TWVN6MDANCNFSM6AAAAAAUJWS6PM> > . > You are receiving this because you authored the thread.Message ID: > ***@***.***> > -- Mit freundlichen Grüßen Wilhelm Kuckelsberg
kuckyder2te commented 2023-02-02 16:28:02 +00:00 (Migrated from github.com)

Arduino MEGA2560 has the following interrupt pins.
2 (Interrupt 0), 3 (Interrupt 1), 18 (Interrupt 5), 19 (Interrupt 4), 20
(Interrupt 3) und 21 (Interrupt 2).

HC_SR04.h
private:
static HC_SR04<TECHO_PIN> *_inst;

void registerInterrupt(int interruptPin)
{
attachInterrupt(interruptPin, HC_SR04::_echo_isr, CHANGE);
Serial.print("interruptPin ");Serial.println(interruptPin);
}

I tried it with Arduino Pin 18, displayed "Interrupt 5". Arduino Pin 2
displayed "Interrupt 0"

Am Do., 2. Feb. 2023 um 15:40 Uhr schrieb Wilhelm Kuckelsberg <
@.***>:

I will set up a GIT tomorrow. Then I can better describe the problem with
pictures. Both simple and simple_async work on the Arduino. Not on the
Pico. I'll send you a code snippet later.

Am Do., 2. Feb. 2023 um 10:41 Uhr schrieb bjoernboeckle <
@.***>:

Ja deutsch ist kein Problem, denke nur englisch wäre besser, falls jemand
anderes ein ähnliches Problem hat und den Verlauf lesen will.
In Zeile 102 steht bei mir nur :"}"
Intern verwende ich die Funktion: "digitalPinToInterrupt(_echo);"
Dann ist es eventuell doch ein Problem mit den Interrupts beim Pico....

Aber Du hattest doch gemeint, das die "Simple" Version auch nicht
funktioniert?
Die verwendet keine Interrupts.

Funktioniert es jetzt bei Dir? Und falls ja was hast Du geändert?


Reply to this email directly, view it on GitHub
https://github.com/bjoernboeckle/HC_SR04/issues/1#issuecomment-1413427998,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AA5HKW6KVKPGR7FIPFBC72TWVN6MDANCNFSM6AAAAAAUJWS6PM
.
You are receiving this because you authored the thread.Message ID:
@.***>

--
Mit freundlichen Grüßen
Wilhelm Kuckelsberg

--
Mit freundlichen Grüßen
Wilhelm Kuckelsberg

Arduino MEGA2560 has the following interrupt pins. 2 (Interrupt 0), 3 (Interrupt 1), 18 (Interrupt 5), 19 (Interrupt 4), 20 (Interrupt 3) und 21 (Interrupt 2). *HC_SR04.h* private: static HC_SR04<TECHO_PIN> *_inst; void registerInterrupt(int interruptPin) { attachInterrupt(interruptPin, HC_SR04::_echo_isr, CHANGE); Serial.print("interruptPin ");Serial.println(interruptPin); } I tried it with Arduino Pin 18, displayed "Interrupt 5". Arduino Pin 2 displayed "Interrupt 0" Am Do., 2. Feb. 2023 um 15:40 Uhr schrieb Wilhelm Kuckelsberg < ***@***.***>: > I will set up a GIT tomorrow. Then I can better describe the problem with > pictures. Both simple and simple_async work on the Arduino. Not on the > Pico. I'll send you a code snippet later. > > Am Do., 2. Feb. 2023 um 10:41 Uhr schrieb bjoernboeckle < > ***@***.***>: > >> Ja deutsch ist kein Problem, denke nur englisch wäre besser, falls jemand >> anderes ein ähnliches Problem hat und den Verlauf lesen will. >> In Zeile 102 steht bei mir nur :"}" >> Intern verwende ich die Funktion: "digitalPinToInterrupt(_echo);" >> Dann ist es eventuell doch ein Problem mit den Interrupts beim Pico.... >> >> Aber Du hattest doch gemeint, das die "Simple" Version auch nicht >> funktioniert? >> Die verwendet keine Interrupts. >> >> Funktioniert es jetzt bei Dir? Und falls ja was hast Du geändert? >> >> — >> Reply to this email directly, view it on GitHub >> <https://github.com/bjoernboeckle/HC_SR04/issues/1#issuecomment-1413427998>, >> or unsubscribe >> <https://github.com/notifications/unsubscribe-auth/AA5HKW6KVKPGR7FIPFBC72TWVN6MDANCNFSM6AAAAAAUJWS6PM> >> . >> You are receiving this because you authored the thread.Message ID: >> ***@***.***> >> > > > -- > Mit freundlichen Grüßen > Wilhelm Kuckelsberg > -- Mit freundlichen Grüßen Wilhelm Kuckelsberg
bjoernboeckle commented 2023-02-03 12:56:23 +00:00 (Migrated from github.com)

Ok, just bought a PICO (actually a Pico W) and tried it on my side, both works the (synchron and the async version) without any issues and changes.

In your case I would not yet look for interrupts, since the synchron version is not using that at all, so its not related to interrupts.

Here is my setup with pin number which is done as you described:

#define ECHO_PIN     21
#define TRIGGER_PIN 22
HC_SR04<ECHO_PIN> sensor(TRIGGER_PIN);   // sensor with echo and trigger pin

And as mentioned both works synchron and asynchron.

Maybe you can share the code which tries to use the library?

Ok, just bought a PICO (actually a Pico W) and tried it on my side, both works the (synchron and the async version) without any issues and changes. In your case I would not yet look for interrupts, since the synchron version is not using that at all, so its not related to interrupts. Here is my setup with pin number which is done as you described: ``` #define ECHO_PIN 21 #define TRIGGER_PIN 22 HC_SR04<ECHO_PIN> sensor(TRIGGER_PIN); // sensor with echo and trigger pin ``` And as mentioned both works synchron and asynchron. Maybe you can share the code which tries to use the library?
kuckyder2te commented 2023-02-03 13:40:58 +00:00 (Migrated from github.com)

Hey Björn,
dare not say, but it works. I don't know what caused it. I checked
everything multiple times.
But now I know your library by heart 😊. It could have been the power
supply.
Now I can finally try to combine the IMU and the ultrasonic sensor. That
was the real problem.

To my person. I am 66 years old and retired. I've only been doing this
hobby for 6 years and I really enjoy it. Even when I communicate with
people like you, it's fun. Unfortunately, such stupid mistakes happen to me
when it was the power supply. But also confusing GPIO pin and internal pin
happens to me.
I hope I didn't annoy you too much.
Best regards
William Kuckelsberg

Am Fr., 3. Feb. 2023 um 13:56 Uhr schrieb bjoernboeckle <
@.***>:

Ok, just bought a PICO (actually a Pico W) and tried it on my side, both
works the (synchron and the async version) without any issues and changes.

In your case I would not yet look for interrupts, since the synchron
version is not using that at all, so its not related to interrupts.

Here is my setup with pin number which is done as you described:

#define ECHO_PIN 21
#define TRIGGER_PIN 22
HC_SR04<ECHO_PIN> sensor(TRIGGER_PIN); // sensor with echo and trigger pin

And as mentioned both works synchron and asynchron.

Maybe you can share the code which tries to use the library?


Reply to this email directly, view it on GitHub
https://github.com/bjoernboeckle/HC_SR04/issues/1#issuecomment-1415835099,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AA5HKWYJQIVKI5MVMGMSLIDWVT6ADANCNFSM6AAAAAAUJWS6PM
.
You are receiving this because you authored the thread.Message ID:
@.***>

--
Mit freundlichen Grüßen
Wilhelm Kuckelsberg

Hey Björn, dare not say, but it works. I don't know what caused it. I checked everything multiple times. But now I know your library by heart 😊. It could have been the power supply. Now I can finally try to combine the IMU and the ultrasonic sensor. That was the real problem. To my person. I am 66 years old and retired. I've only been doing this hobby for 6 years and I really enjoy it. Even when I communicate with people like you, it's fun. Unfortunately, such stupid mistakes happen to me when it was the power supply. But also confusing GPIO pin and internal pin happens to me. I hope I didn't annoy you too much. Best regards William Kuckelsberg Am Fr., 3. Feb. 2023 um 13:56 Uhr schrieb bjoernboeckle < ***@***.***>: > Ok, just bought a PICO (actually a Pico W) and tried it on my side, both > works the (synchron and the async version) without any issues and changes. > > In your case I would not yet look for interrupts, since the synchron > version is not using that at all, so its not related to interrupts. > > Here is my setup with pin number which is done as you described: > > #define ECHO_PIN 21 > #define TRIGGER_PIN 22 > HC_SR04<ECHO_PIN> sensor(TRIGGER_PIN); // sensor with echo and trigger pin > > > And as mentioned both works synchron and asynchron. > > Maybe you can share the code which tries to use the library? > > — > Reply to this email directly, view it on GitHub > <https://github.com/bjoernboeckle/HC_SR04/issues/1#issuecomment-1415835099>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/AA5HKWYJQIVKI5MVMGMSLIDWVT6ADANCNFSM6AAAAAAUJWS6PM> > . > You are receiving this because you authored the thread.Message ID: > ***@***.***> > -- Mit freundlichen Grüßen Wilhelm Kuckelsberg
bjoernboeckle commented 2023-02-03 17:02:21 +00:00 (Migrated from github.com)

Ja wirklich ein großartiges Hobby, sehr oft liegen solche Probleme an irgendwelchen Kleinigkeiten, die man aber auch erstmal finden muss.

Das ist meine erste Library die ich veröffentlich hatte, und auch das erste mall das ein "Issue" gemeldet wurde, deshalb war ich auch recht motiviert das Problem zu finden.

Freut mich auf jeden Fall das es jetzt alles funktioniert (zumindest mit der LIbrary) 😊
Viel Erfolg mit dem Projekt!

Ja wirklich ein großartiges Hobby, sehr oft liegen solche Probleme an irgendwelchen Kleinigkeiten, die man aber auch erstmal finden muss. Das ist meine erste Library die ich veröffentlich hatte, und auch das erste mall das ein "Issue" gemeldet wurde, deshalb war ich auch recht motiviert das Problem zu finden. Freut mich auf jeden Fall das es jetzt alles funktioniert (zumindest mit der LIbrary) 😊 Viel Erfolg mit dem Projekt!
kuckyder2te commented 2023-02-10 22:52:36 +00:00 (Migrated from github.com)

Hallo Björn,
wie angedroht mein Repository mit den Bildern. Sind etwas groß geworden.

https://github.com/kuckyder2te/HCR04_test_PICO

Nochmals vielen Danke für Deine Hilfe.

Am Fr., 3. Feb. 2023 um 18:02 Uhr schrieb bjoernboeckle <
@.***>:

Closed #1 https://github.com/bjoernboeckle/HC_SR04/issues/1 as
completed.


Reply to this email directly, view it on GitHub
https://github.com/bjoernboeckle/HC_SR04/issues/1#event-8434409880, or
unsubscribe
https://github.com/notifications/unsubscribe-auth/AA5HKW2U3MA3XWLAJTMRLZDWVU22TANCNFSM6AAAAAAUJWS6PM
.
You are receiving this because you authored the thread.Message ID:
@.***>

--
Mit freundlichen Grüßen
Wilhelm Kuckelsberg

Hallo Björn, wie angedroht mein Repository mit den Bildern. Sind etwas groß geworden. https://github.com/kuckyder2te/HCR04_test_PICO Nochmals vielen Danke für Deine Hilfe. Am Fr., 3. Feb. 2023 um 18:02 Uhr schrieb bjoernboeckle < ***@***.***>: > Closed #1 <https://github.com/bjoernboeckle/HC_SR04/issues/1> as > completed. > > — > Reply to this email directly, view it on GitHub > <https://github.com/bjoernboeckle/HC_SR04/issues/1#event-8434409880>, or > unsubscribe > <https://github.com/notifications/unsubscribe-auth/AA5HKW2U3MA3XWLAJTMRLZDWVU22TANCNFSM6AAAAAAUJWS6PM> > . > You are receiving this because you authored the thread.Message ID: > ***@***.***> > -- Mit freundlichen Grüßen Wilhelm Kuckelsberg
bjoernboeckle commented 2023-02-12 11:06:36 +00:00 (Migrated from github.com)

Wow sieht gut aus!
Bin mal auf ein Video des fertigen Projekts gespannt :-)

Wow sieht gut aus! Bin mal auf ein Video des fertigen Projekts gespannt :-)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
bjoern/HC_SR04#1
No description provided.