Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Srial.printf not work with X4 rev903 easypack(Solved)
24-11-2013, 11:12 AM, (This post was last modified: 30-11-2013, 09:49 AM by Akhgari.)
#1
Srial.printf not work with X4 rev903 easypack(Solved)
Hi everybody, this is my first post here.
I trying this code on X4 rev903 easypack to make my 4550 communicate with PC using serial port
Code:
int num;
void setup()
{
  Serial.begin(9600);
  num=200;
  }

void loop()
{
// Send numeral through serial port
    Serial.printf( "\n\r ---- Output ---- " );
    Serial.printf( "\n\r Dec  --- " ); Serial.print( num, DEC   );  
    Serial.printf( "\n\r");
    delay(2000);
    num++;
}
compilation done. but nothing send to serial port,but on IDE X3 work.
How to use serial.print and serial printf in X4
Reply
24-11-2013, 03:18 PM, (This post was last modified: 24-11-2013, 03:23 PM by niki_m.)
#2
RE: Srial.printf not work with X4 rev903 easypack
Your code works fine:

---- Output ----
Dec --- 212

---- Output ----
Dec --- 213

---- Output ----
Dec --- 214

---- Output ----
Dec --- 215

---- Output ----
Dec --- 216

---- Output ----
Dec --- 217

---- Output ----
Dec --- 218

---- Output ----
Dec --- 219


Double check your serial terminal settings. May be set to the wrong speed?

(Tested with Easypack rev 903)
Reply
26-11-2013, 10:12 PM,
#3
RE: Srial.printf not work with X4 rev903 easypack
Thanks niki_m, but I compile this code with IDE X3 and it's work and when comple it with IDE X4 ,no error in my code and its say
Code:
Board:     Pinguino 4550
Proc:     18f4550
File:     D:\test\Test Pinguino.pde
compiling...
compilation done
code size: 10112 / 24575 bytes (41% used)
2.8 seconds process time
but I can't see anything.
what is wrong?
Reply
26-11-2013, 10:53 PM,
#4
RE: Srial.printf not work with X4 rev903 easypack
(26-11-2013, 10:12 PM)Akhgari Wrote: when comple it with IDE X4 ,no error
but I can't see anything.
what is wrong?

Interesting...

Look like my problem with CDC..

what operating system are you using? Huh
Reply
27-11-2013, 10:07 AM, (This post was last modified: 27-11-2013, 10:08 AM by regis.)
#5
RE: Srial.printf not work with X4 rev903 easypack
This is not intended to solve your problem, just improve your code Wink :
Code:
Serial.printf( "\n\r Dec  --- " ); Serial.print( num, DEC   );
Why not use printf advantage ?
Code:
Serial.printf( "\n\r Dec  --- %d\n\r", num);
It is easier to complain than it is to do, but it is better to do than it is to complain.
Reply
27-11-2013, 07:59 PM,
#6
RE: Srial.printf not work with X4 rev903 easypack
Test this Code on IDE X4-Rev903-easy pack with windows XP SP3 version 2002.
try this
Code:
void setup()
{
  Serial.begin(9600);
  
  
  }

void loop()
{
Serial.printf( " HELLO " );
}
but nothings see on terminal.
Reply
28-11-2013, 03:45 PM,
#7
RE: Srial.printf not work with X4 rev903 easypack(solved)
I finally solved this problem. I used bootloader 2.12,It seems to problem with serial library IDE X4. upgrading bootloader to 4.14 solve this problem.
thanks all
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)