Grove Ultrasonic Ranger and Timer Issue

Any bugs you encounter with Flowcode should be discussed here.
Post Reply
ConnorTron110
Posts: 2
http://meble-kuchenne.info.pl
Joined: Wed Sep 08, 2021 9:28 pm

Grove Ultrasonic Ranger and Timer Issue

Post by ConnorTron110 »

Hello, I've found a problem with 2 components when they are combined together.
Those components are the Ultrasonic Ranger (Grove 101020010) and the Timer (in the storage component library)
Individually these components work as expected however both placed in the environment with the Arduino Uno board seems to produce an error when compiling to Hex therefore unable to compile to the board.

Is there any workaround to this issue as I need both for my project, thanks in advance!

medelec35
Matrix Staff
Posts: 1449
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 509 times
Been thanked: 472 times

Re: Grove Ultrasonic Ranger and Timer Issue

Post by medelec35 »

Hi.
Can you post your project file (.fcfx extension), so we see what's going on?
Martin

ConnorTron110
Posts: 2
Joined: Wed Sep 08, 2021 9:28 pm

Re: Grove Ultrasonic Ranger and Timer Issue

Post by ConnorTron110 »

Yep, here's a project with the two components mentioned, if you try to compile to hex (or to target) you will see the issue on the log :)
Issue Project.fcfx
(8.55 KiB) Downloaded 88 times

chrisd958
Posts: 7
Joined: Tue Nov 02, 2021 5:01 pm

Re: Grove Ultrasonic Ranger and Timer Issue

Post by chrisd958 »

Yes, I have the same problem and I spent over 2 hours on it before reading this. The thread seems to have gone quiet - is there a workaround or can a different timer be used with Arduino Uno R3 PDIP? I want to use 'ping' and time the measurement. We spent good money on EBlocks2 & Flowcode!

BenR
Matrix Staff
Posts: 1726
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 438 times
Been thanked: 602 times

Re: Grove Ultrasonic Ranger and Timer Issue

Post by BenR »

Hello,

This problem is caused by two things.

1) the timer component is clashing with the free timer component nested inside the ultrasonic component.
warning: "TIM_1_INC" redefined
I have now edited the free timer component to remove this clash and pushed the change to the update system.

2) the timer and the ultrasonic component timer are both pointed at the same timer resource (timer1).
error: redefinition of '__vector_9'
The ultrasonic component is set to time measurement using delays but the definitions for the underlying hardware timer are still active. I haven't yet been able to solve this one for you so you can either change the timer connected to the timer component or you can temporarily change the time measurement of the ranger component to allow you to assign a different timer peripheral.

I might try and solve problem 2 for you but this is a very corner case issue so I might leave it as it is for now.

Post Reply