Charlieplexing library code compiling error

In file included from C:\Program Files (x86)\Arduino\libraries\Charlieplex\examples\SimpleCharlie\SimpleCharlie.pde:12:0:

C:\Program Files (x86)\Arduino\libraries\Charlieplex/Charlieplex.h:11:22: fatal error: WProgram.h: No such file or directory

#include <WProgram.h>

^

compilation terminated.

exit status 1
Error compiling for board Arduino/Genuino Uno.

CODE
** OF**
SIMPLE CHARLIEPLEX

/*
||
|| @author Alexander Brevig
|| @version 1.0
||
/
/

This code is tested with built in led @ pin 13, a led connected with anode 12 cathode 13, and a last led connected with anode 11 cathode 13
I would love feedback at alexanderbrevig@gmail.com
*/

#include <Charlieplex.h>

#define NUMBER_OF_PINS 3
//define pins in the order you want to adress them
byte pins[] = {11,12,13};

//initialize object
Charlieplex charlieplex = Charlieplex(pins,NUMBER_OF_PINS);

//individual 'pins' , adress charlieplex pins as you would adress an array
charliePin led1 = { 1 , 2 }; //led1 is indicated by current flow from 12 to 13
charliePin led2 = { 2 , 1 };
charliePin led3 = { 0 , 2 };

boolean singleOn = false;

void setup(){ /nothing/ }

void loop(){
if (singleOn){ charlieplex.clear(); }

charlieplex.charlieWrite(led1,HIGH);
delay(1000);
charlieplex.charlieWrite(led2,HIGH);
delay(1000);
charlieplex.charlieWrite(led3,HIGH);
delay(1000);

singleOn=!singleOn;
}

Open the file C:\Program Files (x86)\Arduino\libraries\Charlieplex/Charlieplex.h with a text editor.

Change the line:

#include <WProgram.h>

to:

#include <Arduino.h>

Save the file.

Note that this indicates a very old library. You might want to check to see if there is a newer version available.

Hi,
Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.

Thanks.. Tom.. :slight_smile:

Thank you :slight_smile:

i want to code such that for particular object i can start particular led, for another object another led through charlieplexing
can anyone help me out

Akki_099:
C:\Program Files (x86)\Arduino\libraries\Charlieplex\examples\SimpleCharlie\SimpleCharlie.pde:12:0:

That's NOT where you should put a downloaded library. Next update of Arduino IDE and it's gone. It should go into a libraries folder inside your sketchbook. Default C:\Users[userid]\Documents\Arduino\libraries.

Akki_099:
i want to code such that for particular object i can start particular led, for another object another led through charlieplexing
can anyone help me out

I don't understand: Using charlieplexing you can switch on any led at any time IN THE SAME PROJECT.

So what about the circuit you are using:

  • Do you want to use thee Arduino pins to control 6 LEDs?
    Or what?

In case you want to control 6 LEDs with 3 pins, this is the circuit schematics you will need for charlieplexing of low-current LEDs for optical signalling:

You will need:

  • 6 LEDs
  • three resistors
  • one Arduino board (i.e. "UNO") with three pins which are not used otherwise

Do you have this hardware ready (s shown in the picture above)?

resistor value should be calculated from actual operating voltage of the Arduino board and forward voltage or color of the LEDs used in the circuit.

It doesn't make any sense to ask for code if you don't have a suitable hardware ready.

Actually the major problem i face is while lighting LED6 another two leds i.e. LED1 & LED2 also light up.

I have to control 8 pins i.e. 56 LEDs so there will be such problems many time. So can anyone help me out how to solve this hardware problem.

Actually the major problem i face is while lighting LED6 another two leds i.e. LED1 & LED2 also light up.

I have to control 8 pins i.e. 56 LEDs so there will be such problems many time. So can anyone help me out how to solve this hardware problem.

Attachment shows the idea about how i need execute a code

In attachment Dark LINES represent led strips directing to racks i.e A to G racks storing some items.
Adjacent to each LINES pins that needs to be HIGH or LOW are shown in attachment.

[b][i][u]Problem as per attachment is when i want to glow path to rack C then path to rack A also glows.[/u][/i][/b]

As pin1 high and pin2 low
    pin2 high and pin3 low -> which will direct to rack C

   [b]Problem[i][u][/u][/i][/b]
   pin1 high and pin3 low -> at a same time also directs to rack A

All of you can understand If you want to take items from Rack C and rack A also glows then "confusion state".

Can anyone solve this problem???

store[1].jpg

Akki_099:
Actually the major problem i face is while lighting LED6 another two leds i.e. LED1 & LED2 also light up.

cross-check the wiring and polarity of LEDs against the circuit schematics in reply #5!

Akki_099:
I have to control 8 pins i.e. 56 LEDs so there will be such problems many time. So can anyone help me out how to solve this hardware problem.

I don't even have a circuit schematics for 8-pin/56LEDs ready (neither found one on the Internet nor you posted one).

So I just can make a suggestion:

Don't try to create complicated 8-pin/56-LED charlieplexing as long as you are not even able to make the simple 3-pin/6-LEDs charlieplexing work!

P.S.: Charlieplexing does not make more than 1 LED light up at a time.
Charlieplexing just allows to use less pins than LEDs to be controlled.

If you want to see "more than one LED lighting up" at the "same time", you will have to combine the technique of charlieplexing with another technique: time-division multiplexing.

With time-division multiplexing you create a very fast switching, let's say:

  • one miillisecond LED1
  • one millisecond LED2
    one millisecond LED3
    and then repeat cycle from beginning:
    The human eye is slow and for the human eye it will lthen ook as if LED1, LED2 and LED3 are all lighting all the time at the same time.

But time-division multiplexing is a completely different thing than charlieplexing.

If you want to appear" more than one LED lighting at the same time", then you need to use charlieplexing AND time-division multiplexing at the same time in the same sketch.

Using charlieplexing alone (without time-division multiplexing makes exactly ONE LED light up at a time (if the hardware connections are done correctly).

This is a simple circuit but i don't understand how the current flows from other LED which i havent programmed

for e.g.

From 3 pin circuit diagram of charlieplexing

suppose LED1 connection pin1 High and pin2 Low
LED2 connection pin2 High and pin3 Low
&
LED3 connection pin1 High and Pin3 Low

I want to glow LED1 and LED2 and it glows perfectly. But as pin1 remains High and pin 3 remains Low, the circuit gets completed and LED3 also glows.

Now i think you must be clear about the problem scenario.

Hi,
Have you included the resistors?


Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png and a picture of your project?
Charlieplexing also relies on the fact that the outputs are tri state.
So any output that is not going to be HIGH or LOW, needs to be pinMode as INPUT to make the pin high impedance.
The Charlieplex library should take care of that.

Thanks.. Tom... :slight_smile: