I tried ColorWave r(1023, 0, 0.5); and ColorWave::ColorWave r(1023, 0, 0.5);
It works fine in Xcode, but in the Arduino IDE I get :
ShiftBrites_pde.cpp:7:23: error: ColorWave.h: No such file or directory
ShiftBrites_pde.cpp: In function 'void loop()':
ShiftBrites_pde:160: error: 'ColorWave' has not been declared
ShiftBrites_pde:160: error: expected ;' before 'r' ShiftBrites_pde:161: error: 'ColorWave' has not been declared ShiftBrites_pde:161: error: expected ;' before 'g'
ShiftBrites_pde:162: error: 'ColorWave' has not been declared
ShiftBrites_pde:162: error: expected `;' before 'b'
ShiftBrites_pde:181: error: 'r' was not declared in this scope
ShiftBrites_pde:181: error: 'g' was not declared in this scope
ShiftBrites_pde:181: error: 'b' was not declared in this scope
Where is "ColorWave.h" ? Is it in the same folder with your sketch or in libraries folder?
The notation "ColorWave.h" means library is in the same folder with sketch.
The notation <ColorWave.h> means library is in the Arduino environment libraries folder.
It is the problem, since the compiler acts like it's not there.
If the compiler can not open the header file, it will tell you that is no uncertain terms. Since you did not show any message that clearly indicates that the header file can not opened, we must assume that the compiler WAS able to open the file.
Edit: Oops, failed to go back and re-read your first post.
I copied the code at that link, opened the IDE, creating a new sketch. I created a new tab, ColorWave.h, and posted the code there.
It works in a new project but not in the current one.
I couldn't create ColorWave.h in the current project.
java.io.IOException: createNewFile() returned false
at processing.app.Sketch.nameCode(Sketch.java:527)
at processing.app.EditorStatus$3.keyTyped(EditorStatus.java:314)
at java.awt.AWTEventMulticaster.keyTyped(AWTEventMulticaster.java:223)
at java.awt.Component.processKeyEvent(Component.java:6328)
at javax.swing.JComponent.processKeyEvent(JComponent.java:2801)
at java.awt.Component.processEvent(Component.java:6150)
at java.awt.Container.processEvent(Container.java:2085)
at java.awt.Component.dispatchEventImpl(Component.java:4735)
at java.awt.Container.dispatchEventImpl(Container.java:2143)
at java.awt.Component.dispatchEvent(Component.java:4565)
at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1850)
at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:712)
at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:990)
at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:855)
at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:676)
at java.awt.Component.dispatchEventImpl(Component.java:4607)
at java.awt.Container.dispatchEventImpl(Container.java:2143)
at java.awt.Window.dispatchEventImpl(Window.java:2478)
at java.awt.Component.dispatchEvent(Component.java:4565)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:679)
at java.awt.EventQueue.access$000(EventQueue.java:85)
at java.awt.EventQueue$1.run(EventQueue.java:638)
at java.awt.EventQueue$1.run(EventQueue.java:636)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
at java.awt.EventQueue$2.run(EventQueue.java:652)
at java.awt.EventQueue$2.run(EventQueue.java:650)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:649)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)