Pages: 1 ... 18 19 [20]   Go Down
Author Topic: ShiftPWM support topic. Latest update: Schematics, high power LED's, LED strips  (Read 79052 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

I hope someone has done this before and that there is a simple fix for it.

I have a relatively complex system of about 30 or so library files that I am using for a project. One of those files is a 'master' class, allowing me to keep my actual sketch I load onto my arduino super short, like this:

Code:
// sketch
#include "Master.h"

Master myObject;

void setup(){
myObject.begin();
}
void loop(){
myObject.update();
}

I would like to include the ShiftPWM library within this system of files. So, I created my own 'Registers.h' file, which would deal with interacting between my own LED objects in my code and the shiftPWM implementation. The top of my 'Registers.h' file looks like this (similar to how my working sketches look):

Code:
// Registers.h
#define SHIFTPWM_NOSPI
const int ShiftPWM_latchPin = 2;
const int ShiftPWM_dataPin  = 4;
const int ShiftPWM_clockPin = 3;
const bool ShiftPWM_invertOutputs = true;
const bool ShiftPWM_balanceLoad = false;
#include "../ShiftPWM/ShiftPWM.h" // this syntax is required to include this library from within a separate folder

When I go to compile the code, I get the following errors:

Code:
multiple definitions of '__vector_11'
.../ShiftPWM/ShiftPWM.h:175 first defined here
multiple definitions of 'ShiftPWM'
.../ShiftPWM/ShiftPWM.h:175 first defined here

The line the errors are referring to is:
Code:
ISR(TIMER1_COMPA_vect) {
ShiftPWM_handleInterrupt();

It seems, from my research, that people get these sorts of errors when two libraries are trying to use the same timer to handle interrupts. A lot of people experience issues when they try to use the Servo and Tone libraries, for instance. But, I don't think that I am defining ShiftPWM twice, and don't understand why my compiler is suggesting that 'ShiftPWM' and '__vector_11' are first defined in the ISR() macro.

I don't get this error when I run the example sketch Elco Jacobs provides with the libraries. I even crafted my own example sketch only using the ShiftPWM library and all works well.

Is there something particular I need to do to be able to #include this library into one of my own? I feel like there has to be a stupid easy fix that I am just not seeing.

Thanks in advance!





Logged

Offline Offline
Full Member
***
Karma: 3
Posts: 133
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

I get errors while using this with the DUE, so I guess its not ready yet. Any date when its done? Or are there any simple steps to make it work?
My Goal is to have Duo LEDs Shiftpwmed on the DUE smiley
Logged

Kuala Lumpur, Malaysia
Offline Offline
Newbie
*
Karma: 0
Posts: 13
Absorbing knowledge! Will give it back :)
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I have a relatively complex system of about 30 or so library files that I am using for a project. One of those files is a 'master' class, allowing me to keep my actual sketch I load onto my arduino super short, like this:

...

I would like to include the ShiftPWM library within this system of files. So, I created my own 'Registers.h' file, which would deal with interacting between my own LED objects in my code and the shiftPWM implementation. The top of my 'Registers.h' file looks like this (similar to how my working sketches look):

Hi,
I'm not very good in coding Arduinos, but I wonder if you could include the ShiftPWM library into the "master" library?

Just sayin'.
Logged

Napoli
Offline Offline
Sr. Member
****
Karma: 7
Posts: 356
Post fata resurgo
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

let me share an application of ShiftPWM with Souliss to make it controlled over Android and driven by the music played by the smartphone smiley

Regards,
Dario.
Logged

Souliss - Open-source Distributed Home Automation with Arduino and Android

http://www.souliss.net
Follow at @soulissteam

@veseotech

Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi!

I'm running into some troubles using your library together with other devices running off of interrupts and sharing the SPI bus. In our case it's a radio frequency module transceiver, it's for sending data around. Upon receiving a valid preamble it sends an interrupt which triggers the ISR for reading the message from the radios registers, all fine and well, but it stops doing this when used in cominbation with ShiftPWM. I suspect because of interrupts being disabled at some points and atomic operations that need to be protected from other interrupts?

Is there anyone who has experience with this kind of situation?

Another thing, there is a start function, but is there a stop? Any way to disable interrupts for this library (without doing it so globally)?

PS the radio library we are using is this excellent piece of software written by mikem http://www.airspayce.com/mikem/arduino/RF22/
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 1
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I've tried to configure the ShiftPMW with the Arduino Micro using the Leonardo defaults (MOSI and SCK) but I'm getting the following compiling error:

arduino-1.0.5-r2\libraries\ShiftPWM\CShiftPWM.cpp: In member function 'void CShiftPWM::InitTimer2()':
error: 'TCCR2B' was not declared in this scope
 error: 'WGM22' was not declared in this scope
 error: 'TCCR2A' was not declared in this scope
 error: 'WGM21' was not declared in this scope
error: 'WGM20' was not declared in this scope
error: 'CS22' was not declared in this scope
error: 'CS21' was not declared in this scope
error: 'CS20' was not declared in this scope
error: 'CS22' was not declared in this scope
error: 'CS21' was not declared in this scope
error: 'CS20' was not declared in this scope
error: 'CS22' was not declared in this scope
error: 'CS21' was not declared in this scope
error: 'CS20' was not declared in this scope
error: 'CS22' was not declared in this scope
error: 'CS21' was not declared in this scope
error: 'CS20' was not declared in this scope
error: 'CS22' was not declared in this scope
error: 'CS21' was not declared in this scope
error: 'CS20' was not declared in this scope
error: 'CS22' was not declared in this scope
error: 'CS21' was not declared in this scope
error: 'CS20' was not declared in this scope
error: 'OCR2A' was not declared in this scope

I cannot find any suggestions on the support boards so I'm hoping you can offer some guidance.
Thanks
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello, I'm having some trouble with the library, or the examples, not sure which.

I've wired everything according to the schematic, and it all works fine when I connect it to the SPI pins., but when I change to no SPI (I'll need it for a digipot later), they all start twitching and blinking mostly fully on or just something that I can only describe as random behavior. I've tried clearing the code and only setting the values one by one but still, unexpected behavior occurs. Anyone else had this problem and solved it perhaps?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 4
I work with university tech commercialization so I see all types of research. Picked up electronics from my father, and software in my career. Getting into Arduino is the first chance in years to combine my 2 interests.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have not seen any releases of ShiftMatrixPWM since Elco's comment of Aug 9, 2012. Does anyone have a working library (plus any improvements) they would like to share?

I have tried working with an pre-release library posted here a while back, but my C++ is not good enough to update the library. With the release of cheap faster boards like the Teensy 3.1 ($19.80) I'd like to try this library on larger LED arrays if the pinouts could be mapped. (I get PORTB, C, and D errors on compile). Adding setPinGrouping(smiley-cool to use with 8x8 LED boards from ShiftPWM would also be helpful. I for one would be willing to test the code on a number of LED configurations.

 
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi all,

I have problems with using the shiftpwm library with the EthernetUdp or the ArdOSC libraries.

Here is my code:

Code:
#include <SPI.h>
#include <Ethernet.h>
#include <ArdOSC.h>

byte myMac[] = {0x90, 0xA2, 0xDA, 0x0F, 0x37, 0xEF  };
byte myIp[]  = { 2, 0, 0, 50 };
int  serverPort  = 12334;

int pin=100;
int value=100;
int t=100;

OSCServer server;

const int ShiftPWM_latchPin=8;
// #define SHIFTPWM_NOSPI
// const int ShiftPWM_dataPin = 11;
// const int ShiftPWM_clockPin = 13;

const bool ShiftPWM_invertOutputs = false;
const bool ShiftPWM_balanceLoad = false;

#include <ShiftPWM.h> 

unsigned char maxBrightness = 255;
unsigned char pwmFrequency = 75;
int numRegisters = 8;

int r = 0;

void setup()   {     
  Ethernet.begin(myMac ,myIp);
 server.begin(serverPort);
 
  //set callback function
 server.addCallback("/wall/1",&func1);

  ShiftPWM.SetAmountOfRegisters(numRegisters);
  ShiftPWM.Start(pwmFrequency,maxBrightness); 
  ShiftPWM.SetAll(r);
}

void loop() {
  if(server.aviableCheck()>0){   
    ShiftPWM.SetOne(pin, value);
  } 
}

void func1(OSCMessage *_mes){
  pin = _mes->getArgInt32(0);
  value = _mes->getArgInt32(1);
}
   

If I comment this line in the void setup: ShiftPWM.Start(pwmFrequency,maxBrightness);
then everything if fine. But of course I need it to use shiftPWM. Uncommenting the lines for the noSPI option didn't do the trick either.

Any help is greatly appreciated!

p
Logged

Offline Offline
Newbie
*
Karma: 1
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Does anyone know how to combine ShiftPWM with DMXSerial? Or know of any similar solutions? Working on the code but gets errors. I can share what I have.
« Last Edit: April 09, 2014, 02:42:11 pm by p0ldek » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

So I am jumping on the RGB matrix bandwagon.

I've desgined a PCB which seems similar to what elco posted, except that instead of the FET/Diode/595 arrangement for the row drivers, I just have a MIC2981. Would this work, or do I need to do add something else?
Logged

Pages: 1 ... 18 19 [20]   Go Up
Jump to: