chipKIT® Development Platform

Inspired by Arduino™

Converting library from arduino to chipkit

Created Fri, 06 Dec 2013 21:27:38 +0000 by moore.2134


moore.2134

Fri, 06 Dec 2013 21:27:38 +0000

For starters, I am a novice when it comes to writing code for chipkit and arduino. I have a basic understanding but I ran into a problem that is over my head and would like some help. I am trying to make an 8x24 scrolling led matrix and I have code to do it for 8x8. The problem is the code uses a frequencytimer2 library that I cannot for the life of me get to work on my chipkit. It runs perfectly on my ardunio but when I extract the library file into the mpide library folder it says that the file avr/interrupt.h cannot be found. I am assuming it has something to do with referencing ardunio stuff and not mpide stuff but as I said before, its over my head. Attached is the library folder if anyone can take a look at it and see if they can get it to work with chipkit. My board is a PIC32MX320F128H if that information is needed. I am also using the 0022 version because I have heard that the 0023 version is troublesome. Thanks.


majenko

Sun, 08 Dec 2013 00:18:54 +0000

All these things sound to me like they will be riddled with AVR specific code, and would be a nightmare to port.

How are you wanting to connect the matrix up? Direct parallel? Shift registers? IO expanders?

I have a TFT library that has support for LED matrices up to 32x32, and larger by linking multiple 32x32 blocks together. I have only used that part of the library so far with direct parallel connection, but the way the library is written it is possible to get it to work with any number of other ways of linking the LEDs up.

[url]https://github.com/majenkotech/chipKIT-TFT[/url]

It's an incredibly complex library, and will have far more in it than you are wanting, but feel free to take bits of it and build your own code out of it. The important parts are the LEDMatrix.{cpp|h} files, and maybe some of the communication files, like RawPar.{cpp|h}

And I would strongly recommend upgrading to 0023. 0023 is a blanket number coveing many many different versions of the IDE, and yes there were some problems with some versions. Right now though it's pretty stable and reliable. The latest version is always available here: [url]http://chipkit.s3.amazonaws.com/index.html[/url]

Or, if you fancy an adventure, why not check out UECIDE and have all your development in one place - Arduino, chipKIT, Launchpad, Maple... ;)