chipKIT® Development Platform

Inspired by Arduino™

Uno32 Onboard LEDs on Pin13 and Pin43

Created Tue, 14 Jun 2011 17:59:40 +0000 by wjwalrus


wjwalrus

Tue, 14 Jun 2011 17:59:40 +0000

Everybody from Arduino knows about the pin13 LED (labeled LD4 on the Uno32 board). Uno32 also has a second LED on pin43, labeled LD5.

Note that only the pin13 signal is wired to both the LED and the physical I/O pin 13 on the board. The pin43 LED signal is not connected to a board I/O pin, but may used for program control of the LED in the usual way: pinMode(43, OUTPUT); digitalWrite(43, HIGH);


GeneApperson

Mon, 27 Jun 2011 15:16:50 +0000

After all of the other pins had been assigned to connectors, I had one pin left over. Rather than let it go to waste, I put in an extra LED.

Gene Apperson Digilent


CNCaddict

Thu, 14 Jul 2011 00:21:52 +0000

speaking of LED 43. Would it be possible to show what needs changing in the "fade" example. I can only manage a blinking led. Thanks for the great product.


CNCaddict

Thu, 14 Jul 2011 01:04:48 +0000

OK, I figured it out :D This works perfect, although I think it's only stuck to a few pins (OC1, OC2,...,etc)

/* Fade

This example shows how to fade an LED on pin 9 using the analogWrite() function.

This example code is in the public domain.

*/ int brightness = 1; // how bright the LED is int fadeAmount = 1; // how many points to fade the LED by

void setup() { // declare pin 3 to be an output: pinMode(3, OUTPUT);

// Open Timer2, 1:1 w/2048 tick interval (for 11-bit PWM) OpenTimer2(T2_ON | T2_PS_1_1,2048); OpenOC1(OC_ON | OC_TIMER2_SRC | OC_PWM_FAULT_PIN_DISABLE, 0,0); }

void loop() { // set the brightness of pin 3: SetDCOC1PWM(brightness);

// change the brightness for next time through the loop: brightness = brightness + fadeAmount;

// reverse the direction of the fading at the ends of the fade: if (brightness == 1 || brightness == 2047)
// wait for 5 milliseconds to see the dimming effect
delay(5);
}