Hi
I am trying to control the leds (for debugging and monitoring purposes).
I succeed to turn on and off the green LEDs as descriced in the example that comes with it. I can not control the color of these LEds to Red or orange and I can not control the other LEDs (The RED blinking LEDs during programming).
Can you refer me to a more elaborated example and/or documentation in this regards?
Thanks
Controlling LEDS in Pcan Router Pro
- PEAK-Support
- Sales & Support
- Posts: 1646
- Joined: Fri 10. Sep 2010, 19:34
Re: Controlling LEDS in Pcan Router Pro
Did you use the PPCAN-Editor and configure the module, or do you use the C-Compiler and build a own firmware - this importend information is missing...
--------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------
Re: Controlling LEDS in Pcan Router Pro
Sorry. I thought it was obvious.
I use the C compiler, writing my own code.
I use the C compiler, writing my own code.
- PEAK-Support
- Sales & Support
- Posts: 1646
- Joined: Fri 10. Sep 2010, 19:34
Re: Controlling LEDS in Pcan Router Pro
please take a look into the hardware.h file:
you will also find the definitions for the LEDs
and the color
Code: Select all
//! Set a LED to a specific color.
//!
//! @param hLED handle of the LED, see LED-handles
//! @param color color to set, see HW_LED_RED ...
//!
//! @return one error of HW_ERR_...
HWStatus_t HW_SetLED ( LEDHandle_t hLED, LEDColor_t color);
Code: Select all
////////////////////////////////////////////////////////////
//! @name LED-handles
//! Handles to the LEDs. Not all LEDs are available on all targets.
#define HW_LED_STATUS 0 //!< status LED
#define HW_LED_CAN1 1 //!< LED CAN1
#define HW_LED_CAN2 2 //!< LED CAN2
#define HW_LED_CAN3 3 //!< LED CAN3
#define HW_LED_CAN4 4 //!< LED CAN4
#define HW_LED_CAN1b 5 //!< second LED CAN1
#define HW_LED_CAN2b 6 //!< second LED CAN2
#define HW_LED_CAN3b 7 //!< second LED CAN3
#define HW_LED_CAN4b 8 //!< second LED CAN4
Code: Select all
////////////////////////////////////////////////////////////
//! @name LED-colors
//! Colors used for the LEDs
#define HW_LED_OFF 0 //!< LED switch OFF
#define HW_LED_RED 1 //!< LED switch red
#define HW_LED_GREEN 2 //!< LED switch green
#define HW_LED_ORANGE 3 //!< LED switch orange
--------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------
Re: Controlling LEDS in Pcan Router Pro
Thanks!
I saw all that and tried to change color of main LEDs (HW_LED_CANx) and succeeded only to set it to green or off.
for the secondary leds (HW_LED_CANxb) I couldn't set it at all. Continously off no matter what color I set.
HW_SetLED ( HW_LED_CAN4b, HW_LED_RED); should work?
I saw all that and tried to change color of main LEDs (HW_LED_CANx) and succeeded only to set it to green or off.
for the secondary leds (HW_LED_CANxb) I couldn't set it at all. Continously off no matter what color I set.
HW_SetLED ( HW_LED_CAN4b, HW_LED_RED); should work?
Re: Controlling LEDS in Pcan Router Pro
Hello there.
PCAN-Router Pro has -no- multicolor LEDs at CAN ports.
One is green and one is red.
You just may set them to either ON or OFF.
- - -
The file is written to fit all our hardware products,
like e.g. PCAN Router which indeed has 2 multicolor LEDs.
But not 4 as defined in the file.
Also you may find that the PCAN-Router has no beeper ...
Greetings
Stefan
PCAN-Router Pro has -no- multicolor LEDs at CAN ports.
One is green and one is red.
You just may set them to either ON or OFF.
- - -
The file is written to fit all our hardware products,
like e.g. PCAN Router which indeed has 2 multicolor LEDs.
But not 4 as defined in the file.
Also you may find that the PCAN-Router has no beeper ...
Greetings
Stefan