Go Down

Topic: Floating point problem on UDOO (Due) - IDE 1.5.4 (Read 1 time) previous topic - next topic

ckuehnel

Dec 28, 2013, 01:28 pm Last Edit: Dec 28, 2013, 01:31 pm by Claus Reason: 1
I tried some FP math on UDOO without success.
Here is a simple test which doesn't work too.

MarkT

PLEASE PLEASE don't post screenshots of your code, post the actual code,
we need to copy/paste it to test it....   

Read the sticky threads about how to use this forum.
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

ckuehnel

Ok, here it is.

Code: [Select]
float x = 123.45;
int y=0;
int z=123;

void setup() {
  Serial.begin(115200);
  delay(4000);
  Serial.println("Start...");

}

void loop() {
  Serial.println(z);
  y = int(x);
  Serial.println(y);
  delay(1000);
}

MarkT

Thanks

Nothing wrong with that example for me, tried on Due 1.5.4, Mega 1.0.5, both
run fine.

Perhaps your USB->serial link is dropping out - loose the delays and see what happens.
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

pito

y = int (x); // integer like in Basic?
or
y = (int) x;
??

ckuehnel

In my Duemilanove it works too. The problems I have are on UDOO.

MarkT


In my Duemilanove it works too. The problems I have are on UDOO.

It works on the Due, sounds like an UDOO issue, do they have a forum?
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

Go Up