Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


"Expected an expresson"

SD_new_guySD_new_guy United StatesMember Posts: 4

Super new to C (this is my first program).
The following is a snippet of the program which is giving me errors when I try to compile. I tried to follow the syntax rules closely, but maybe I just dont understand them.
Can anyone help?

MSP430G2231 Microcontroller.
IDE: IAR v 5.52.1, Embedded components v

volatile signed int OFF;
volatile unsigned int dT;

define C2 = 6981;

define D2 = 26603;

define UT1 = 26016;

A dT = (D2-UT1); // Diff bet. ref. and actual temp.
B TEMP = 200+((dT151)/2048)+10000; // Actual temperature.
C OFF = C2+((-31
dT)/4096)+10000; // Offset at actual temperature.

Re lines A and C, the compiler says "expected an expression". I thought they were expressions. Line B compiles fine. Why is the compiler giving me these error messages?


Sign In or Register to comment.