Jump to content

Recommended Posts

Thank you so much we really need help! Here are the errors we got:

project3-1.ino:50:10: error: expected constructor, destructor, or type conversion before '(' token
project3-1.ino:51:10: error: expected constructor, destructor, or type conversion before '(' token
project3-1.ino:52:10: error: expected constructor, destructor, or type conversion before '(' token
project3-1.ino:53:10: error: expected constructor, destructor, or type conversion before '(' token
project3-1.ino:54:10: error: expected constructor, destructor, or type conversion before '(' token
project3-1.ino:55:10: error: expected constructor, destructor, or type conversion before '(' token
project3-1.ino:56:10: error: expected constructor, destructor, or type conversion before '(' token
project3-1.ino:57:10: error: expected constructor, destructor, or type conversion before '(' token
project3-1.ino:58:10: error: expected constructor, destructor, or type conversion before '(' token
project3-1.ino:59:10: error: expected constructor, destructor, or type conversion before '(' token
project3-1.ino:60:10: error: expected constructor, destructor, or type conversion before '(' token
project3-1.ino:61:10: error: expected constructor, destructor, or type conversion before '(' token
project3-1.ino:77:24: error: storage size of 'inputed_array' isn't known
project3-1.ino:83:10: error: expected constructor, destructor, or type conversion before '(' token
project3-1.ino: In function 'double calculatePPM(int)':
project3-1.ino:135:2: error: expected ';' before '}' token
project3-1.ino:140:5: error: expected ';' before 'Rs'
project3-1.ino:150:5: error: expected ';' before 'Rs'
project3-1.ino:160:5: error: expected ';' before 'Rs'
project3-1.ino: In function 'void float2Bytes(float, byte*)':
project3-1.ino:178:10: error: 'flt_array' was not declared in this scope
project3-1.ino: In function 'void LCD_INITIALIZE()':
project3-1.ino:195:65: error: assigning to an array from an initializer list
project3-1.ino:197:65: error: assigning to an array from an initializer list
project3-1.ino:199:65: error: assigning to an array from an initializer list
project3-1.ino:202:66: error: assigning to an array from an initializer list
project3-1.ino:203:64: error: assigning to an array from an initializer list
project3-1.ino:204:64: error: assigning to an array from an initializer list
project3-1.ino:205:67: error: assigning to an array from an initializer list
project3-1.ino:206:65: error: assigning to an array from an initializer list
project3-1.ino: In function 'int array_to_lcd_converter(double*, int)':
project3-1.ino:230:3: error: 'm' was not declared in this scope
project3-1.ino:231:3: error: 'num' was not declared in this scope
project3-1.ino:236:68: error: assigning to an array from an initializer list
project3-1.ino:237:70: error: assigning to an array from an initializer list
project3-1.ino:241:67: error: assigning to an array from an initializer list
project3-1.ino:245:69: error: assigning to an array from an initializer list
project3-1.ino:249:69: error: assigning to an array from an initializer list
project3-1.ino:252:10: error: 'pos' was not declared in this scope
project3-1.ino:254:8: error: expected '(' before 'inputed_array'
project3-1.ino:381:1: error: expected '}' at end of input
project3-1.ino:381:1: error: expected '}' at end of input

Project.ino

Share this post


Link to post
Share on other sites

Looks like you copy&pasted from several examples.

 

1) Energia (and Arduino) sketches require that the main code is inside setup and loop, with the exception of code contained in separate functions. You have a lot of code that sits outside, e.g. all the pin mode setup needs to go inside setup.

 

2) A lot of syntax errors, that might or might not be caught by the compiler, e.g.

 

if (m==1); {                            // PPM Calculation for H
.. 
}

will not do what you expect. The ; ends the if clause. The code inside the bracket will always executed no matter whether m is equal to one.

 

3) some if statements are missing brackets, e.g. if inputed_array[num]==1

 

4) this kind of assignment only works for initializing variables

 

DB_PINS = {HIGH, LOW, LOW, HIGH, LOW, LOW, LOW, LOW, HIGH, HIGH};

 

5) seems a few curly brackets got lost

 

Looking at the kind of errors you struggle with, I suggest you work through the tutorials before copying other peoples code.

http://energia.nu/Guide_index.html

http://arduino.cc/en/Tutorial/HomePage

 

When you copy code, try to go step by step. Start with blinking a LED, add a few lines of copied code in steps, read the error, look at the line number it refers to, fix it before moving on.

Share this post


Link to post
Share on other sites

Looks like you copy&pasted from several examples.

 

1) Energia (and Arduino) sketches require that the main code is inside setup and loop, with the exception of code contained in separate functions. You have a lot of code that sits outside, e.g. all the pin mode setup needs to go inside setup.

 

2) A lot of syntax errors, that might or might not be caught by the compiler, e.g.

if (m==1); {                            // PPM Calculation for H
.. 
}

will not do what you expect. The ; ends the if clause. The code inside the bracket will always executed no matter whether m is equal to one.

 

3) some if statements are missing brackets, e.g. if inputed_array[num]==1

 

4) this kind of assignment only works for initializing variables

DB_PINS = {HIGH, LOW, LOW, HIGH, LOW, LOW, LOW, LOW, HIGH, HIGH};

5) seems a few curly brackets got lost

 

Looking at the kind of errors you struggle with, I suggest you work through the tutorials before copying other peoples code.

http://energia.nu/Guide_index.html

http://arduino.cc/en/Tutorial/HomePage

 

When you copy code, try to go step by step. Start with blinking a LED, add a few lines of copied code in steps, read the error, look at the line number it refers to, fix it before moving on.

@@chicken

Thank you but we didn't really copy that much we took ideas and went step by step and wrote most of this ourselves but it looks choppy because we recently combined it all. All of our errors now are just for converting our float value to byte array. We need to output a decimal value onto an LCD and we are looking everywhere and can't find something that can help. Do you know how to do this? We are thinking about using Serial.Printin() but we don't know how to correspond that with the pins we're using

Share this post


Link to post
Share on other sites

As the compiler tries to tell you, there's a lot of syntax errors to fix first. Including a few errors that the compiler did not catch (e.g. lines 234, 239, 243, 247).

 

I'd approach the problem like this:

1) figure out how to read the sensor and whether that part works, use Serial.Println() and the serial console to verify you get the values you expect

2) figure out how to control the LCD, the code in your file definitely won't work (or even compile), just display a few known characters for a start

3) figure out how to convert a float into a string or array of characters, this thread might help (including the caveat in case you're using MSP430) http://forum.43oh.com/topic/3464-casting-or-converting-numeric-types-to-string-in-energia/ again use Serial.Println() to verify that you actually get what you expect.

4) combine what you learned, but in a more deliberate way than the example you posted above.

Share this post


Link to post
Share on other sites

@@chicken OK so we changed a ton! Could you look over it again?

 

Here's our new errors:

C:\hardware\msp430\libraries\SoftwareSerial\SoftwareSerial.cpp:81:2: error: #error This version of SoftwareSerial supports only 16MHz processors
C:\hardware\msp430\libraries\SoftwareSerial\SoftwareSerial.cpp: In member function 'void SoftwareSerial::begin(long int)':
C:\hardware\msp430\libraries\SoftwareSerial\SoftwareSerial.cpp:251:31: error: 'table' was not declared in this scope
C:\hardware\msp430\libraries\SoftwareSerial\SoftwareSerial.cpp: In member function 'virtual size_t SoftwareSerial::write(uint8_t)':
C:\hardware\msp430\libraries\SoftwareSerial\SoftwareSerial.cpp:319:26: error: 'XMIT_START_ADJUSTMENT' was not declared in this scope
 

Project.ino

Share this post


Link to post
Share on other sites

@@chicken

Everytime I add in #define <math.h> it doesn't go red like all the other libraries do and I'm getting errors about my log. It says that I have ram and rom overflow, is that because the log number is too large? I'm trying to create a look-up table

Share this post


Link to post
Share on other sites

@@chicken

Everytime I add in #define <math.h> it doesn't go red like all the other libraries do and I'm getting errors about my log. It says that I have ram and rom overflow, is that because the log number is too large? I'm trying to create a look-up table

Why would you

#define <math.h>
instead of

#include <math.h>
... like you were suggested to do?

Share this post


Link to post
Share on other sites

Please do not try to use SoftwareSerial in your sketch.  Use the hardware serial ports "Serial", "Serial1", "Serial2" etc. in your application.  SoftwareSerial is only designed to run on a very specific set of MSP430 chips, not Tiva.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...