Pages: [1]   Go Down
Author Topic: digitalPinHasPWM on the due?  (Read 720 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Jr. Member
**
Karma: 1
Posts: 66
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The macro digitalPinHasPWM seams to be missing on Arduino 1.5.2

Can it be defined for the due?
Logged

US
Offline Offline
Full Member
***
Karma: 4
Posts: 182
Electronics are the new Legos
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It would be easy to write one using the data on which pins have PWM, a function with a switch to return TRUE if it matches one, FALSE if not.
Logged

Offline Offline
Jr. Member
**
Karma: 1
Posts: 66
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It would be easy to write one using the data on which pins have PWM, a function with a switch to return TRUE if it matches one, FALSE if not.

Sure,
but I think as the Arduino IDE does #define it for the other Arduinos it *would be* nice for the user to find that defined also on the Due. Or doesn't it make sense for that chip? (and if so, why?).

btw:  How can I detect the Due?
#ifdef  __SAM3X8E__ or is there something more specific?
Logged

US
Offline Offline
Full Member
***
Karma: 4
Posts: 182
Electronics are the new Legos
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes, I agree the software should be fairly complete to help get programs going.

the define you have is the right one for now.
Logged

Forum Administrator
Milano, Italy
Offline Offline
Sr. Member
*****
Karma: 22
Posts: 291
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


opened an issue to keep track of this:
https://github.com/arduino/Arduino/issues/1342

as always, if someone wants to try an implementation, I'll be happy to merge it.

C
Logged

C.

Offline Offline
Jr. Member
**
Karma: 1
Posts: 66
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


opened an issue to keep track of this:
https://github.com/arduino/Arduino/issues/1342

as always, if someone wants to try an implementation, I'll be happy to merge it.


Left a note about me using
#define digitalPinHasPWM(p)         ((p) >= 2 && (p) <= 13)

I will probably raise issues on other macros missing, like:
portModeRegister

and then I did not find out yet how to use these:
- digitalPinToPort
- digitalPinToBitMask
any pointers very welcome


Thanks a lot for your help,
very much appreciated.
Logged

Pages: [1]   Go Up
Jump to: