Cube4 Compiler Error/ Missing Driver /Windows8 / IDE 1.0.5

The "Cube4" is a 4x4x4 RGB LED cube with an Arduino Leonardo compatible onboard controller. [Product page]
vero96
Posts: 25
Joined: Sat Jun 01, 2013 10:08 pm

Cube4 Compiler Error/ Missing Driver /Windows8 / IDE 1.0.5

Post by vero96 » Sat Jun 01, 2013 11:03 pm

Hi after purchasing a 4x4x4 Cube the first thing I did was build it, downloaded the code from https://github.com/freetronics/Cube4 extracted the zip file and renamed it and dropped it into the Arduino Libraries folder. ( OS Windows 8 pro / Arduino 1.0.5 )

The build went fine (thanks to the great instructional video) on plugging the Cube4 in the test patten sketch that is preloaded ran perfectly. I was also able to play with the cube via the serial monitor running at the specified 115200 baud rate. However when I attempted to Verify/Compile an example sketch I received the error - cube does not name a type - subsequently this happens with all examples from the above URL - here is the code -

Code: Select all

 /*
 * File:    AccelerometerColour.ino
 * Version: 1.0
 * Author:  Jonathan Oxer (jon@freetronics.com)
 * License: GPLv3
 */

/*
 * Note: this sketch requires an analog accelerometer to be connected to the Cube,
 * with the Z-axis output connected to analog input A2 on the Cube. A suitable
 * accelerometer is the AM3X: www.freetronics.com/am3x
 */

#include "SPI.h"
#include "Cube.h"

Cube cube;

void setup(void) {
  // Serial port options for control of the Cube using serial commands are:
  // 0: Control via the USB connector (most common).
  // 1: Control via the RXD and TXD pins on the main board.
  // -1: Don't attach any serial port to interact with the Cube.
  cube.begin(0, 115200); // Start on serial port 0 (USB) at 115200 baud
  pinMode(A2, INPUT);
}

void loop(void) {
  int zReading = analogRead(A2);
  if(zReading > 300)
  {
    cube.all(BLUE);
  }
  if(zReading < 200)
  {
    cube.all(GREEN);
  }
}   

Also under the Resources section at http://www.freetronics.com/collections/ ... ap4_Jx5d3P Cube driver installation is greyed out my question is, do I need that driver? and if so when would it become available or is there a problem with the code? failing that based on what I have written is there an indication that I have made a mistake somewhere.

Any feed back would be much appreciated, Thanks in advance.

vero96
Posts: 25
Joined: Sat Jun 01, 2013 10:08 pm

Re: Cube4 Compiler Error/ Missing Driver /Windows8 / IDE 1.0

Post by vero96 » Wed Jun 05, 2013 8:38 am

Thank you for your reply, However it seems I am still having problems when attempting to run the same example sketch with the relevant libraries imported here are the results with error code. Also - #include <Cube.h> is the only - #include <example.h> that appears in orange? from my experience they all should ie. <engine.h>, <colour.h>, <graphics.h> ect.

code-

Code: Select all

 #include <color.h>
#include <Cube.h>
#include <engine.h>
#include <graphics.h>
#include <parser.h>
#include <serial.h>

/*
 * File:    AccelerometerColour.ino
 * Version: 1.0
 * Author:  Jonathan Oxer (jon@freetronics.com)
 * License: GPLv3
 */

/*
 * Note: this sketch requires an analog accelerometer to be connected to the Cube,
 * with the Z-axis output connected to analog input A2 on the Cube. A suitable
 * accelerometer is the AM3X: www.freetronics.com/am3x
 */

#include "SPI.h"
#include "Cube.h"

Cube cube;

void setup(void) {
  // Serial port options for control of the Cube using serial commands are:
  // 0: Control via the USB connector (most common).
  // 1: Control via the RXD and TXD pins on the main board.
  // -1: Don't attach any serial port to interact with the Cube.
  cube.begin(0, 115200); // Start on serial port 0 (USB) at 115200 baud
  pinMode(A2, INPUT);
}

void loop(void) {
  int zReading = analogRead(A2);
  if(zReading > 300)
  {
    cube.all(BLUE);
  }
  if(zReading < 200)
  {
    cube.all(GREEN);
  }
} 


in the console this line of code is highlighted in yellow

Code: Select all

   cube.all(BLUE);
error - to many initializes for 'rgb_t'

As I am unaware of how to include the errors (error code/message) that show up below in the output when the script does not compile (which are many). I apologize for not including them as I am aware they are of use as to resolving the issue. If any one knows how to do this instructions would be greatly appreciated, as it is not simply a matter of copy and paste. Again any input would be greatly appreciated thanks in advance.
Last edited by vero96 on Thu Jun 06, 2013 3:13 am, edited 1 time in total.

angusgr
Freetronics Staff
Freetronics Staff
Posts: 853
Joined: Tue Apr 09, 2013 11:19 pm
Location: Melbourne, Australia
Contact:

Re: Cube4 Compiler Error/ Missing Driver /Windows8 / IDE 1.0

Post by angusgr » Wed Jun 05, 2013 10:02 pm

vero96 wrote:As I am unaware of how to include the errors (error code/message) that show up below in the output when the script does not compile (which are many) I apologize for not including them as I am aware they are of use as to resolving the issue. If any one know how to do this instructions would be greatly appreciated as it is not simply a matter of copy and paste. Again any input would be greatly appreciated thanks in advance.
The Arduino IDE has a bug in that choosing Copy from the Edit menu does not work (as you've seen), but you can copy text from the output pane by selecting it and typing Ctrl-C. Annoying I know, it took me a long time before I discovered this as well!

vero96
Posts: 25
Joined: Sat Jun 01, 2013 10:08 pm

Re: Cube4 Compiler Error/ Missing Driver /Windows8 / IDE 1.0

Post by vero96 » Thu Jun 06, 2013 3:49 am

Here are the errors that show up in the output after attempting to compile an example sketch re: Cube. Thanks to angusgr for the info on copy and paste, these are the errors mentioned above in my previous post. From the example AccelerometerColour

Code: Select all

     cube.all(BLUE);
cube.all(BLUE); is highlighted in yellow however I assume this is just one of many errors due to the information below - the code below appears in the output section and is orange.

Code: Select all

In file included from AccelerometerColour.ino:1:
C:\Arduino1.5.0\Arduino\libraries\Cube4/color.h:12: error: 'byte' does not name a type
In file included from AccelerometerColour.ino:6:
C:\Arduino1.5.0\Arduino\libraries\Cube4/serial.h:14: error: redefinition of 'const byte NUL'
C:\Arduino1.5.0\Arduino\libraries\Cube4/parser.h:11: error: 'const byte NUL' previously defined here
C:\Arduino1.5.0\Arduino\libraries\Cube4/serial.h:20: error: redefinition of 'const byte SPACE'
C:\Arduino1.5.0\Arduino\libraries\Cube4/parser.h:12: error: 'const byte SPACE' previously defined here
C:\Arduino1.5.0\Arduino\libraries\Cube4/serial.h:22: error: redefinition of 'const byte RBRAC'
C:\Arduino1.5.0\Arduino\libraries\Cube4/parser.h:13: error: 'const byte RBRAC' previously defined here
AccelerometerColour.ino: In function 'void loop()':
AccelerometerColour:39: error: too many initializers for 'rgb_t'
AccelerometerColour:43: error: too many initializers for 'rgb_t'
  
Consequently every other Library works fine and in reply to Tronixstuff everything appears to be in the right place and works? Hopefully the above information will shed some light on the topic.

angusgr
Freetronics Staff
Freetronics Staff
Posts: 853
Joined: Tue Apr 09, 2013 11:19 pm
Location: Melbourne, Australia
Contact:

Re: Cube4 Compiler Error/ Missing Driver /Windows8 / IDE 1.0

Post by angusgr » Thu Jun 06, 2013 11:16 pm

Hi vero96,

Thanks for posting the error output. Just a couple of quick questions to double-check things:

- What board do you have selected under Tools -> Board?

- You say you're using IDE 1.0.5, but the path to your Arduino install indicates the 1.5.0 beta release. Can you confirm the version you're using? I just checked and the Cube4 examples build for me under Linux on 1.5.0 so this shouldn't be the issue, but it doesn't hurt to be sure. I also tested 1.0.5 and the 1.5.2 beta under Windows 8 and they worked for me (32-bit Windows 8 unfortunately, I don't have a 64-bit install handy.)

If none of those points ring a bell, can you please go to File -> Preferences and enable "Show Verbose output when... compiling". Then copy/paste all the verbose compiler output (you'll have to do a bit of click-and-drag fussing around to select it all unfortunately, resizing the bottom pane will help, and then use Ctrl-C keyboard shortcut to Copy as the Arduino Edit->Copy won't work) and post that as well? It may be quite a lot of output so you may want to use a service like http://pastebin.com and just post a link.

Hopefully we'll get to the bottom of this soon. :)

BiggusD
Posts: 4
Joined: Tue Jun 25, 2013 6:09 am

Re: Cube4 Compiler Error/ Missing Driver /Windows8 / IDE 1.0

Post by BiggusD » Tue Jun 25, 2013 9:06 am

Hi, just to let u guys know, i have exactly the same problem as this guy. I tried it with version 1.05 and 1.02 . Both gave me the same error- 'cube does not name a type'
Ive had no trouble with a leostick or eleven. It just doesent seem to like the code that is specific to the cube
Cheers

angusgr
Freetronics Staff
Freetronics Staff
Posts: 853
Joined: Tue Apr 09, 2013 11:19 pm
Location: Melbourne, Australia
Contact:

Re: Cube4 Compiler Error/ Missing Driver /Windows8 / IDE 1.0

Post by angusgr » Wed Jun 26, 2013 1:02 am

BiggusD wrote:Hi, just to let u guys know, i have exactly the same problem as this guy. I tried it with version 1.05 and 1.02 . Both gave me the same error- 'cube does not name a type'
Er, that's quite the Monty Python reference there BD. :)

Interesting to learn someone else has the exact same problem. I haven't heard back from vero96 yet, but if you have time could you please try the other two things (double-checking Board, and copying the verbose compiler output) I mentioned in the previous post in this thread and let us know?

- Angus

vero96
Posts: 25
Joined: Sat Jun 01, 2013 10:08 pm

Re: Cube4 Compiler Error/ Missing Driver /Windows8 / IDE 1.0

Post by vero96 » Wed Jun 26, 2013 2:26 am

Hi, angusgr thanks for your help, I did indeed have the 1.0.5 IDE installed and running and Leonardo selected as the board. After many frustrating attempts to get the cube running on a whim I just plugged it in, and in the task bar ( win8pro ) the new device detected icon appeared and started installing the driver????????? This I can not explain however was happy that the cube was finally working. I then ran most of the examples and the cube worked fine and I was pretty :D with my self. DISCLAIMER - I am not blaming anyone for what happened next I feel it is important/relevant to the OP - So having been the first customer to have purchased this particular product from the local retail outlet from which I shop with some regularity, on return to the outlet to pick up some items, I took with me my flashy (poor pun) cube. The staff were interested to see it in action ( quiet day ) so a senior member plugged the cube in to an available USB port and the previously uploaded example sketch ran no problems. However some ten minutes later I had what I needed and was ready to head to the check out - where the cube was amusing customers and staff alike. On processing my order one of the staff noticed that there was a device driver install needing approval ( the same PC my cube was plugged into ) the staff member canceled the install and I'm not sure if the cube was safely removed as a device. What's the point??? when I got it home and plugged it in the cube that had been working perfectly 45 minutes ago didn't work that is. The blue LED next to the reset switch on the bottom of the cube came on ( and stays on ) and I now get a error message from the IDE telling me I haven't selected a com port, and a Windows errors message 15 seconds or so after plugging it in that the USB device is not recognized by windows and has malfunctioned. After many, many wasted hours of hoping the reset button, repeated plug in's would save me I turned to google and the Arduino ISP as a programmer. Having a Leostick on hand I tried unsuccessfully to Burn the bootloader from the Leostick to the Cube. I also used a AtMega_Board_Detector ( Found via the Arduino forum ) using an Eleven I was able to "detect" the Cube's ATmel 32u4 and associated fuses and the rest the relevent information that piece of code generated however that chip is not supported by the programmer ( correct me if I'm wrong ) I would have included that info here as I know it may be useful but the IDE does not want to play right now. Since the driver error messages I have tried the cube with 1.03 & 1.0.5 on the win 8 pro, in a win7 machine IDE 1.0.2 & 1.0.3 also a Linux (mint/ubuntu) machine 1.0.5 the cube is just not being recognized which I find odd because the chip reader knew exactly what chip/fuses/ect. the cube was programmed with so I'm at a loss if anyone has any clue feel free to share. In response to BiggusD I think I just got lucky mate so I have no sage words of advice sorry! but that changed! Any help would be greatly appreciated.

Thanks in advance vero

angusgr
Freetronics Staff
Freetronics Staff
Posts: 853
Joined: Tue Apr 09, 2013 11:19 pm
Location: Melbourne, Australia
Contact:

Re: Cube4 Compiler Error/ Missing Driver /Windows8 / IDE 1.0

Post by angusgr » Wed Jun 26, 2013 3:57 am

Hi vero,

Thanks for the update. Sorry to hear you've had such trying times with your Cube!
vero96 wrote:After many frustrating attempts to get the cube running on a whim I just plugged it in, and in the task bar ( win8pro ) the new device detected icon appeared and started installing the driver????????? This I can not explain however was happy that the cube was finally working. I then ran most of the examples and the cube worked fine and I was pretty :D with my self.
Interesting. That's really strange that it seemed to be related to drivers, the errors you were originally reporting were all at the Compile (aka "Verify") stage, before the Arduino IDE even looks for a serial port so the drivers should have been totally unrelated to those problems.

At any rate, glad it was working!
vero96 wrote:On processing my order one of the staff noticed that there was a device driver install needing approval ( the same PC my cube was plugged into ) the staff member canceled the install and I'm not sure if the cube was safely removed as a device.
I think that's fine. None of that should make a different to the cube, the only time unplugging it might be unsafe would be when an upload is in progress (and even then the worst that would happen is it would need re-uploading.)
vero96 wrote:What's the point??? when I got it home and plugged it in the cube that had been working perfectly 45 minutes ago didn't work that is. The blue LED next to the reset switch on the bottom of the cube came on ( and stays on )
The blue light is the power light, so that's OK. If it flashes other colours this indicates serial traffic.

Unfortunately the Cube doesn't have a "breathing" bootloader LED like the LeoSticks do.
vero96 wrote:and I now get a error message from the IDE telling me I haven't selected a com port, and a Windows errors message 15 seconds or so after plugging it in that the USB device is not recognized by windows and has malfunctioned.
Weird!

To use the Cube successfully with Windows and with "Arduino Leonardo" selected as the board type, you need to have installed both the Freetronics Windows drivers for the bootloader and also the Arduino Windows drivers. Without both of these then you'll see Windows "unknown device" errors.

This is because the bootloader (which runs after you press Reset, or during the upload process) reports as a Freetronics device to Windows, but when the sketch runs it reports as an Arduino device. When you press reset, the Cube becomes "Freetronics LeoStick Bootloader" for 8 seconds and then runs the sketch, which will be "Arduino Leonardo".

The best way to see what's going on is to open Device Manager (on Windows 8, type Win-X and then click Device Manager.)

(As an aside, if you download and use the LeoStick board profile and choose "Freetronics LeoStick V2" in the Arduino IDE instead, then the sketch can run using the Freetronics drivers as well so you don't need the Arduino ones. But it can't hurt to install both.)

vero96 wrote:After many, many wasted hours of hoping the reset button, repeated plug in's would save me I turned to google and the Arduino ISP as a programmer. Having a Leostick on hand I tried unsuccessfully to Burn the bootloader from the Leostick to the Cube. I also used a AtMega_Board_Detector ( Found via the Arduino forum ) using an Eleven I was able to "detect" the Cube's ATmel 32u4 and associated fuses and the rest the relevent information that piece of code generated however that chip is not supported by the programmer ( correct me if I'm wrong ) I would have included that info here as I know it may be useful but the IDE does not want to play right now.
That's strange that you could read data but not burn the bootloader using ArduinoISP on the Eleven. The Cube should already have the LeoStick bootloader on it though (you should see it come up in the Device Manager when it's running.)
vero96 wrote:Since the driver error messages I have tried the cube with 1.03 & 1.0.5 on the win 8 pro, in a win7 machine IDE 1.0.2 & 1.0.3 also a Linux (mint/ubuntu) machine 1.0.5 the cube is just not being recognized
Linux should be a bit more flexible with this because it doesn't require the driver .INF files. Provided it's not a virtual machine (if it's a virtual machine then you need to make sure the USB devices automatically attach to the VM, as the Cube will automatically detach/reattach as a "different" device when it switches between bootloader and sketch.)

If it's not working on a "real" Linux computer, can you provide any more details about what goes wrong?
vero96 wrote:which I find odd because the chip reader knew exactly what chip/fuses/ect. the cube was programmed with so I'm at a loss if anyone has any clue feel free to share.
There are some circumstances where the programmer/ICSP interface will work but not the USB bootloader. Once you get time to provide a few more details we should be able to narrow it down.

Thanks for your patience,

- Angus

BiggusD
Posts: 4
Joined: Tue Jun 25, 2013 6:09 am

Re: Cube4 Compiler Error/ Missing Driver /Windows8 / IDE 1.0

Post by BiggusD » Wed Jun 26, 2013 9:45 am

In light of my lack of knowledge about computers im going to
A-try plugging the cube in 100 times
B-try removing the drivers and try them all separately etc & on a different computer and..
C-hope that by the time ive finished these steps that u smarter guys have figured out a better solution!
But i was thinking along similar lines... It seems to be the compiler dosent recognise what a cube is, so does the compiler look at the drivers? Or does installing new drivers affect the compiler bit of the program
Or am i getting confused because sometimes i feel like my brain dosent get enough blood supply for some reason
Cheers

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests