non-class type error

(unfinished) sketch:

#include <seg.h>

Seg seg();

void setup()

void loop()
digitalWrite(2, HIGH);;
digitalWrite(2, LOW);
digitalWrite(3, HIGH);
digitalWrite(3, LOW);
digitalWrite(4, HIGH);

Header File:

#ifndef Seg_h
#define Seg_h

#include “WProgram.h”

class Seg
void one();
void two();
void three();
void four();
void five();
void six();
void seven();
void eight();
void nine();
void zero();


Source File:

#include “WProgram.h”
#include “Seg.h”

pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
pinMode(7, OUTPUT);
pinMode(8, OUTPUT);
pinMode(9, OUTPUT);
pinMode(10, OUTPUT);
pinMode(11, OUTPUT);
pinMode(12, OUTPUT);
pinMode(13, OUTPUT);
void Seg::one()
digitalWrite(6, HIGH);
digitalWrite(7, LOW);
digitalWrite(8, LOW);
digitalWrite(9, HIGH);
digitalWrite(10, HIGH);
digitalWrite(11, HIGH);
digitalWrite(12, HIGH);
digitalWrite(13, HIGH);
void Seg::two()
digitalWrite(6, LOW);
digitalWrite(7, LOW);
digitalWrite(8, HIGH);
digitalWrite(9, LOW);
digitalWrite(10, LOW);
digitalWrite(11, HIGH);
digitalWrite(12, LOW);
digitalWrite(13, HIGH);
So on and so forth to 9.

This is a library to control a 4 digit, 7segment led display.

When I try to compile what i have so far it highlights ";" and says “seg_seg:11: error: request for member ‘one’ in ‘seg’, which is of non-class type ‘Seg () ()’”

Any ways to fix this?


This declares a function which RETURNS a Seg:

Seg seg();

I think what you intended to do was declare "seg" as an instance of Seg:

Seg seg;

Post you r code so we can see all of it.

And please use the # button for posting code to get it proper tagged with [ code] tags, looks so much better.

It was too long so i couldnt post it, i only cout out the repetitive stuff.

I did "Seg seg;" instead of "Seg seg();" and it worked. Thanks