View unanswered posts | View active topics It is currently Mon Sep 21, 2020 3:15 pm

Reply to topic  [ 2 posts ] 
Just learning C, I have a rookie question 
Author Message

Joined: Sun Oct 06, 2013 11:33 pm
Posts: 1
Post Just learning C, I have a rookie question
So to learn C I set a goal that I thought was realistic and tried to write the code to make it happen.

My first goal is to simply make a counter on the display. I want to get it to count from 0 to 200 then stop. "tall" is just a random name I picked. I noticed in robotc that "tall" is in black text not colored. I know the code as it is will not work, it gives me a "Procedure call Parameter" error for the displayLCDCenteredString line of code. Any help for this would be great. Thanks in advance. Jay

task main ()
int tall = 0;

while ( tall < 200)

bLCDBacklight = true;
displayLCDCenteredString(0,tall); //How to I display the value of "tall" in the display

tall ++;



Sun Oct 06, 2013 11:48 pm
User avatar

Joined: Sat May 18, 2013 1:24 pm
Posts: 271
Location: Olympia, WA
Post Re: Just learning C, I have a rookie question
And by the way, next time add
around your code to make it more readable ;)
What you need to do for `displayLCDCenteredString` is use something like this:
displayLCDCenteredString(0, "%f", tall);

Does that work?
See this page for further reference.
Do note that in everyday programming, the use of ellipses is quite rare, and it's considered "evil" by many :) But "printf" is a pretty standard function.

FTC Team 6424, the 'Oly Cow - Chief programmer.
FRC Team 4450, Olympia Robotics Federation (ORF).

and also quadrotors. Quadrotors!

Mon Oct 07, 2013 9:44 pm
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.