PyroPropeller Clock

Off-topic Or Otherwise...Say/Ask It Here
saransound
Newbie Pyro
Posts: 11
Joined: Thu Aug 29, 2013 6:56 am

PyroPropeller Clock

Postby saransound » Thu Dec 26, 2013 11:02 am

Hello , I want to know if the LED's have to be connected in an order to latch. The circuit shows 16 LEDs but i have used 13 LEDs so which latch do i fill up first. And how to wire the remaining 5 leds to the other latch.
Attachments
schematic_large.png
schematic_large.png (34.5 KiB) Viewed 3652 times

ThePyroElectro
PyroElectro Admin
Posts: 1181
Joined: Mon Nov 12, 2007 9:24 pm
Location: Earth
Contact:

Re: PyroPropeller Clock

Postby ThePyroElectro » Sun Mar 09, 2014 3:50 am

Hi,

From the source code:

Code: Select all

void set_leds(unsigned long int leds){

PORTA = 0x0F;
PORTC = 0xF0;

LED_LATCH_L = 1;
LED_LATCH_L = 0;

PORTA = leds & 0x0F;
PORTC = leds & 0xF0;

LED_LATCH_H = 1;
LED_LATCH_H = 0;

}


While the code will tell all 16 outputs to do something, I didn't actually use 16 LEDs because I ran out of space.

The closest LED to the middle will be Bit 0 of the Lower LED Latch enabled by PORTBbits.RB5.

The furthest LED from the middle will be Bit 7 of the Higher LED Latch enabled by PORTBbits.RB4

Good luck!


Return to “Put'm Here”

Who is online

Users browsing this forum: No registered users and 1 guest