blueroomelectronics
Well-Known Member
Charliplexing LEDs is a great way to run many LEDs with only a few I/O pins. It's a little tricker than directly driving an LED but since it's a tutor you're bound to learn something. One catch is only ONE LED can be lit at a time, so the trick is called refreshing. Your eyes have persistence of vision and anything flickering faster than about 20ms (50Hz) will not appear to be flickering.
https://en.wikipedia.org/wiki/Charlieplexing
https://www.instructables.com/id/Charlieplexing-LEDs--The-theory/
As wonderful as Swordfish BASIC is (and it makes programming VERY easy) it's not going to give you the insight or release the real power of a PIC. Understanding some PIC assembly code will prove very helpful, and serious users will want C (like the free C18 SE compiler from Microchip)
That said Swordfish BASIC is simply the best PIC BASIC I've ever used by a long shot.
The Swordfish forums have lots of code examples.
https://www.sfcompiler.co.uk/forum/
https://en.wikipedia.org/wiki/Charlieplexing
https://www.instructables.com/id/Charlieplexing-LEDs--The-theory/
As wonderful as Swordfish BASIC is (and it makes programming VERY easy) it's not going to give you the insight or release the real power of a PIC. Understanding some PIC assembly code will prove very helpful, and serious users will want C (like the free C18 SE compiler from Microchip)
That said Swordfish BASIC is simply the best PIC BASIC I've ever used by a long shot.
Code:
Case 1 // LED 1
TRISA.7 = 1 // This makes the pin an input / high impedance (open)
High(PORTA.0) // automatically sets the pin to output and logical high (1)
Low (PORTA.6) // automatically sets the pin to output and logical low (0)
https://www.sfcompiler.co.uk/forum/