seven segment display RL78 - F13 R5F10BMG

I tried this code for displaying 0 to 99 on a seven segment display using Arduino UNO.

i tried making few changes to this to make it compatible with R5F10BMG (RL78/F13) using CS+ IDE

It is showing Syntax error along with few others... 

Please share a source code if possible for the same.

 

//---------------------------------CODE STARTS-------------------------------------------------

 

#define A 7
#define B 8
#define C 9
#define D 10
#define E 11
#define F 12
#define G 13
#define DP 6

#define disp3 3
#define disp4 2


#define duration 5000


#define numbersegments \
{ \
{1,1,1,1,1,1,0,0},\
{0,1,1,0,0,0,0,0},\
{1,1,0,1,1,0,1,0},\
{1,1,1,1,0,0,1,0},\
{0,1,1,0,0,1,1,0},\
{1,0,1,1,0,1,1,0},\
{1,0,1,1,1,1,1,0},\
{1,1,1,0,0,0,0,0},\
{1,1,1,1,1,1,1,0},\
{1,1,1,0,0,1,1,0},\
}

 

byte numbers[10][8] = numbersegments;                     // Syntax error in this line************ "byte" is not supported in CS+
const int segments[8] = {A, B, C, D, E, F, G, DP};

 

void setup()
{
pinMode(A, OUTPUT);
pinMode(B, OUTPUT);
pinMode(C, OUTPUT);
pinMode(D, OUTPUT);
pinMode(E, OUTPUT);
pinMode(F, OUTPUT);
pinMode(G, OUTPUT);
pinMode(DP, OUTPUT);

pinMode(disp3, OUTPUT);
pinMode(disp4, OUTPUT);
digitalWrite(A, LOW);
digitalWrite(B, LOW);
digitalWrite(C, LOW);
digitalWrite(D, LOW);
digitalWrite(E, LOW);
digitalWrite(F, LOW);
digitalWrite(G, LOW);
digitalWrite(DP, LOW);

digitalWrite(disp3, LOW);
digitalWrite(disp4, LOW);
}

 


void loop()
{
for (int digit4=0; digit4<10; digit4++)
{
for (int digit3=0; digit3<10; digit3++)

{
for (int t=0; t<60; t++)
{

setsegments(digit3, disp3, duration);
setsegments(digit4, disp4, duration);
}
}
}
}

 


void setsegments(int number, int digit, int ontime)
{
for (int seg=0; seg<8; seg++)
{
if(numbers[number][seg]==1)
{
digitalWrite(segments[seg], HIGH);
}
else
{
digitalWrite(segments[seg], LOW);
}
}
digitalWrite(digit, HIGH);
delayMicroseconds(ontime);
digitalWrite(digit, LOW);
}

//-------------------------------------CODE ENDS------------------------------------------------

  • Hi Pritam,

    It seems that there are a lot of codes in your program that is incompatible with the IDE and the device that you are using. You need to initialize the port of the device that you want to use as output in a way that it could be recognized by your IDE and compiler. You need to setup the timer too to generate delay. Please refer to this datasheet www.renesas.com/.../r01uh0368ej0210_rl78f13_14.pdf

    JB
    RenesasRulz Forum Moderator
  • Pritam,

    Have you managed to get your code working?

    Mike Clements
    RenesasRulz Moderator
  • This thread will be archived due to inactivity.

    Mke Clements
    RenesasRulz Moderator