// To blink the LEDs on SSD
#define a 2// connecting segment a to PIN2
#define b 3// connecting segment b to PIN3
#define c 4// connecting segment c to PIN4
#define d 5// connecting segment d to PIN5
#define e 6// connecting segment e to PIN6
#define f 8// connecting segment f to PIN8
#define g 9// connecting segment g to PIN9
void setup(){
pinMode(a, OUTPUT);
pinMode(b, OUTPUT);
pinMode(c, OUTPUT);
pinMode(d, OUTPUT);
pinMode(e, OUTPUT);
pinMode(f, OUTPUT);
pinMode(g, OUTPUT);
}
// Code to blink the seven segment display
// To display digit from 0 to 4
void loop()
{
//ZERO
digitalWrite(a,HIGH);
digitalWrite(b,HIGH);
digitalWrite(c,HIGH);
digitalWrite(d,HIGH);
digitalWrite(e,HIGH);
digitalWrite(f,HIGH);
digitalWrite(g,LOW);
delay(1000);
//ONE
digitalWrite(a,LOW);
digitalWrite(b,HIGH);
digitalWrite(c,HIGH);
digitalWrite(d,LOW);
digitalWrite(e,LOW);
digitalWrite(f,LOW);
digitalWrite(g,LOW);
delay(1000);
//TWO
digitalWrite(a,HIGH);
digitalWrite(b,HIGH);
digitalWrite(c,LOW);
digitalWrite(d,HIGH);
digitalWrite(e,HIGH);
digitalWrite(f,LOW);
digitalWrite(g,HIGH);
delay(1000);
//THREE
digitalWrite(a,HIGH);
digitalWrite(b,HIGH);
digitalWrite(c,HIGH);
digitalWrite(d,HIGH);
digitalWrite(e,LOW);
digitalWrite(f,LOW);
digitalWrite(g,HIGH);
delay(1000);
//FOUR
digitalWrite(a,LOW);
digitalWrite(b,HIGH);
digitalWrite(c,HIGH);
digitalWrite(d,LOW);
digitalWrite(e,LOW);
digitalWrite(f,HIGH);
digitalWrite(g,HIGH);
delay(1000);
}
This is a code to display 0-4 numbers on a seven segment display. Here, I've used a-g as variables.But, apparently 'c' already used as a variable in library files 'WCharacter.h' and 'WString.h'. So, while running this code, I'm getting an error as follows
/usr/share/arduino/hardware/arduino/cores/arduino/WString.h:108:29: note: in expansion of macro ‘c’
__ String & operator += (char c) {concat(c); return (this);}__
** ^*
This is the case with only on PCs having Linux OS. In Windows, this code compiles with zero errors.