Skip to content

3 compile errors in the example sketch HardwareTimerPWMInput.in #509

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mrguen opened this issue Apr 26, 2019 · 7 comments
Closed

3 compile errors in the example sketch HardwareTimerPWMInput.in #509

mrguen opened this issue Apr 26, 2019 · 7 comments
Labels
invalid This doesn't seem right question ❓ Usually converted as a discussion

Comments

@mrguen
Copy link
Contributor

mrguen commented Apr 26, 2019

Hello,

I am looking for a way to use TIMER INPUT and found this nice example sketch " HardwareTimerPWMInput.in" but there are a few compilation errors:

  1. Streaming.h: No such file or directory

Then after removing this include:

HardwareTimerPWMInput:28:9: error: no match for 'operator<<' (operand types are 'USBSerial' and 'const char [80]')

Serial << "Example of the Timer Input Capture mode to measure PWM pulse width and period\n\n";

HardwareTimerPWMInput:73:61: error: 'endl' was not declared in this scope

Serial << ", period: " << Timer2.getCompare(TIMER_CH1) << endl;

Configuration:
Win 7 64 pro
Arduino IDE 1.8.9
Arduino_Core_STM32 1.5.0 updated via boards manager

@fpistm
Copy link
Member

fpistm commented Apr 26, 2019

Hi @mrguen
This is normal as this example is not for this core. It is for this one:
https://github.com/rogerclarkmelbourne/Arduino_STM32
which is different.

@fpistm fpistm added invalid This doesn't seem right question ❓ Usually converted as a discussion labels Apr 26, 2019
@mrguen
Copy link
Contributor Author

mrguen commented Apr 26, 2019

@fpistm Ok, there is still something that I don't get: why the rest of the code compiles? For example I thought there was no support for TIMER INPUT in Arduino_Core_STM32 (couldn't find this defines in the core) but this code compiles with TIMER_IC_INPUT_DEFAULT and it uses the predefined timer instances...

Also: is it possible to use all timers configuration (INPUT CAPTURE etc) within Arduino_Core_STM32 ?

@fpistm
Copy link
Member

fpistm commented Apr 26, 2019

TIMER_IC_INPUT_DEFAULT is not defined in this core.
This core uses the CMSIS definition and STM32 HAL/LL from STMicrolectronics.
You can see #473 (an example is available in #447).
To use it you need to use the GitHub repository as I do not yet release it yet.
Furthermore an HardwareTimer library will be provide later to handle more easily Timer features (#146)

@fpistm
Copy link
Member

fpistm commented Apr 26, 2019

Maybe, but I could not tell you why.
You use a sketch which is not for this core so I could not help you on this.
As it seems you use also @rogerclarkmelbourne core, use this example with this core.

@mrguen
Copy link
Contributor Author

mrguen commented Apr 26, 2019

Ok, I was confused because the boards manager shows "STM32F1Boards (STM32duino.com)" so I thought It was refering to an Arduino_Core_STM32 board. In fact I am using Roger Clark Melbourne libraries. Thanks for the fast answer.

@fpistm
Copy link
Member

fpistm commented Apr 26, 2019

Welcome.
So you should open an issue here:
https://github.com/rogerclarkmelbourne/Arduino_STM32/issues

@fpistm
Copy link
Member

fpistm commented Apr 26, 2019

Close this one as OP open rogerclarkmelbourne/Arduino_STM32#626

@fpistm fpistm closed this as completed Apr 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right question ❓ Usually converted as a discussion
Projects
None yet
Development

No branches or pull requests

2 participants