Home \ Help \ Search \ Login RSS

Welcome, Guest. Please Login

This forum is now READ-ONLY! Please visit http://forum.wiring.co/ for the new forum.

Wiring ForumProgramming Questions & HelpSyntax › Array of objects..

Page Index Toggle Pages: 1
Array of objects.. (Read 5121 times)
05/12/08 at 14:21:02

julienb   Offline
Junior Member
wiring AND arduino owner
France

Posts: 81
**
 
Hello!!

I cannot understand why this declaration doesn't work :

Code:
led[][] leds = new led[8][8]  ;

class led {
  int x,y;
  int state;
  int color;


  led (int xi, int yi, int statei, int colori) {
    x = xi;
    y = yi;
    state = statei;
    color = colori;
  }

  void ledOff()
  {
    state = 0;
  }

  void ledOn()
  {
    state = 1;
  }

  void ledBlink()
  {
    state = 2 ;
  }
} 



is it the same problem of "not finished array implementation" ??
 

IP Logged
 
Reply #1 - 05/12/08 at 15:29:26

barragan   Offline
YaBB Administrator

Posts: 939
*****
 
Wiring is not Java, to give you an idea Wiring is to C++ as Processing is to Java, here is the source code of different libraries for you to look at:
http://wiring.uniandes.edu.co/source/trunk/wiring/lib/Stepper/Stepper.cpp?revision=412&view=markup this one is the stepper motor library, but all of them are there for you to llok at. I will post later today an example for creating your own.
 
IP Logged
 
Reply #2 - 05/12/08 at 15:35:47

julienb   Offline
Junior Member
wiring AND arduino owner
France

Posts: 81
**
 
I hadn't understood that (I may be a  big newbie)

I coded a lot of things in Processing, and, I didn't really change anything in Wiring style code since today..
And I'm discovering that Smiley

I'll sleep a little bit less stupid tonight :p
thanks for the link !!

I'm going to post another topic about Serial Data protocol.
 

IP Logged
 
Page Index Toggle Pages: 1