Please help!

I know there are a lot of fellow members that code. If anyone can help me with line two.

Error: exit status 1 array must be initialized with a brace-enclosed initializer

Im using Arduino Uno

Code below:

int ectPin = 9; int vec[7] = (1197, 1034, 553, 368, 274, 182);

void setup() { pinMode(ectPin, OUTPUT); }

void loop () { analogWrite (ectPin, 255); delay(30); analogWrite (ectPin, 0); delay(vec[0]); }

int vec[7] = {1197, 1034, 553, 368, 274, 182};

Braces {}

Please, please use code tags when posting code.

BTW, you have six initialisers for a seven element array. The last one (vec[6]) will be zero.

AWOL: int vec[7] = {1197, 1034, 553, 368, 274, 182};

Braces {}

Please, please use code tags when posting code.

BTW, you have six initialisers for a seven element array. The last one (vec[6]) will be zero.

thanks for the fast response , it worked now

i’d like to use these values can any one tweak my code

int vec[7] = {1200, 1150, 1100, 1000, 500, 274};

//ECT converter from civic eg sensor to s2000 cluster
//Version 1.0


#include <TimerOne.h> //this library will allow us to use pwm signals with custom period

int ectOut = 9;
int ectIn = A1;
int adcValue=0; //ect voltage in range between 0 and 1023
unsigned long ectBars[7]={1500000,1100000,700000,400000,300000,220000,150000}; //microseconds from 1 to 7 segments
int ectADC[6]={203,156,122,84,53,19}; //correspondence between bars and temperature (in adc units) (71,82,93,104,115,126 celsius)

long waitUntil=0; //timer
int update = 5000; //reading ect sensor only every 5 seconds

void setup(){
  pinMode(ectOut, OUTPUT); //sets the pin as output
  pinMode(ectIn, INPUT); //sets the pin as input    
  
  Timer1.initialize(); //initializing the Timer1, so we can use pwm function
  Timer1.pwm(ectOut,20,1530000); //we set the new custom pwm on vssOut pin
}

int ectReadandUpdate(){
  adcValue = analogRead(ectIn); //read the ect voltage
    
  //we match the voltage to his microseconds that represents x segments  
  if (adcValue == 0){
    Timer1.pwm(ectOut,20,ectBars[0]+30000); //we set the new custom pwm on ectOut pin
  }
  else if(adcValue < ectADC[5]){
    Timer1.pwm(ectOut,171,ectBars[6]+30000); //we set the new custom pwm on ectOut pin
  }
  else if(adcValue < ectADC[4]){
    Timer1.pwm(ectOut,122,ectBars[5]+30000); //we set the new custom pwm on ectOut pin
  }  
  else if(adcValue < ectADC[3]){
    Timer1.pwm(ectOut,93,ectBars[4]+30000); //we set the new custom pwm on ectOut pin
  }    
  else if(adcValue < ectADC[2]){  
    Timer1.pwm(ectOut,71,ectBars[3]+30000); //we set the new custom pwm on ectOut pin
  }
  else if(adcValue < ectADC[1]){
    Timer1.pwm(ectOut,42,ectBars[2]+30000); //we set the new custom pwm on ectOut pin
  }
  else if(adcValue < ectADC[0]){
    Timer1.pwm(ectOut,27,ectBars[1]+30000); //we set the new custom pwm on ectOut pin
  }
  else{
    Timer1.pwm(ectOut,20,ectBars[0]+30000); //we set the new custom pwm on ectOut pin
  }
}
 
void loop(){
  
  //we read ect sensor every 5 seconds
  if (millis() >= waitUntil){ ;
    ectReadandUpdate();
    waitUntil = millis() + update; 
  } 
}

i'd like to use these values can any one tweak my code

Sorry, I'm really uncomfortable about electro-convulsive therapy.

Please read these two posts:

How to use this forum - please read.
and
Read this before posting a programming question …
You have posted code without using code tags. The code tags make the code look

like this

when posting source code files. It makes it easier to read, and can be copied with a single mouse click. Also, if you don’t do it, some of the character sequences in the code can be misinterpred by the forum code as italics or funny emoticons.
If you have already posted without using code tags, open your message and select “modify” from the pull down menu labelled, “More”, at the lower left corner of the message. Highlight your code by selecting it (it turns blue), and then click on the “</>” icon at the upper left hand corner. Click on the “Save” button. Code tags can also be inserted manually in the forum text using the [code] and [/code] metatags.

Sorry, I'm really uncomfortable about code that's not between code tags..

fixed

Can someone help me modify this code with the following integers? Please and thank you.

int vec[7] = {1150, 800, 750, 500, 475, 200 ,100}

//ECT converter from civic eg sensor to s2000 cluster
//Version 1.0


#include <TimerOne.h> //this library will allow us to use pwm signals with custom period

int ectOut = 9;
int ectIn = A1;
int adcValue=0; //ect voltage in range between 0 and 1023
unsigned long ectBars[7]={1500000,1100000,700000,400000,300000,220000,150000}; //microseconds from 1 to 7 segments
int ectADC[6]={203,156,122,84,53,19}; //correspondence between bars and temperature (in adc units) (71,82,93,104,115,126 celsius)

long waitUntil=0; //timer
int update = 5000; //reading ect sensor only every 5 seconds

void setup(){
  pinMode(ectOut, OUTPUT); //sets the pin as output
  pinMode(ectIn, INPUT); //sets the pin as input    
  
  Timer1.initialize(); //initializing the Timer1, so we can use pwm function
  Timer1.pwm(ectOut,20,1530000); //we set the new custom pwm on vssOut pin
}

int ectReadandUpdate(){
  adcValue = analogRead(ectIn); //read the ect voltage
    
  //we match the voltage to his microseconds that represents x segments  
  if (adcValue == 0){
    Timer1.pwm(ectOut,20,ectBars[0]+30000); //we set the new custom pwm on ectOut pin
  }
  else if(adcValue < ectADC[5]){
    Timer1.pwm(ectOut,171,ectBars[6]+30000); //we set the new custom pwm on ectOut pin
  }
  else if(adcValue < ectADC[4]){
    Timer1.pwm(ectOut,122,ectBars[5]+30000); //we set the new custom pwm on ectOut pin
  }  
  else if(adcValue < ectADC[3]){
    Timer1.pwm(ectOut,93,ectBars[4]+30000); //we set the new custom pwm on ectOut pin
  }    
  else if(adcValue < ectADC[2]){  
    Timer1.pwm(ectOut,71,ectBars[3]+30000); //we set the new custom pwm on ectOut pin
  }
  else if(adcValue < ectADC[1]){
    Timer1.pwm(ectOut,42,ectBars[2]+30000); //we set the new custom pwm on ectOut pin
  }
  else if(adcValue < ectADC[0]){
    Timer1.pwm(ectOut,27,ectBars[1]+30000); //we set the new custom pwm on ectOut pin
  }
  else{
    Timer1.pwm(ectOut,20,ectBars[0]+30000); //we set the new custom pwm on ectOut pin
  }
}
 
void loop(){
  
  //we read ect sensor every 5 seconds
  if (millis() >= waitUntil){ ;
    ectReadandUpdate();
    waitUntil = millis() + update; 
  } 
}

jealous1shateric:
Can someone help me modify this code with the following integers? Please and thank you.
int vec[7] = {1150, 800, 750, 500, 475, 200 ,100}

You haven’t given any information about what you want to do with those values, so how can anyone help you?

AWOL: Sorry, I'm really uncomfortable about electro-convulsive therapy.

LOL. Engine Coolant Temperature apparently.

OldSteve: You haven't given any information about what you want to do with those values, so how can anyone help you?

The code I posted I want to modify it with the int vec numbers I posted. It an ect code for pwm using older Honda ect sensor. The values I posted light up different corresponding bars on the temp gauge. If anyone could help me i'd greatly appreciate.

The code I posted I want to modify it with the int vec numbers

Got it. Well, go ahead. Modify it to your heart's content.

If you need help, quit whining and say what you want to change, where the new values are to come from, etc.

jealous1shateric: The code I posted I want to modify it with the int vec numbers I posted. It an ect code for pwm using older Honda ect sensor. The values I posted light up different corresponding bars on the temp gauge. If anyone could help me i'd greatly appreciate.

You still tell us nothing about exactly which part of your code you wish to modify with those values, and how you want to do it. From the information you've provided so far, no one can help you.

Pleasw close figured it out on my own, thanks guys