|
Page 1 of 1
|
[ 11 posts ] |
|
Program doesn`t start after turning brick off and on
Author |
Message |
FosterChip
Rookie
Joined: Wed Apr 25, 2012 11:56 am Posts: 6 Location: Russia, Tomsk
|
 Program doesn`t start after turning brick off and on
Afetr compile and downloading program to brick it works perfectly. But when I turn brick off and than turn it on I try to start program. All I see is text "%program name% running". And nothing works. Screen doesn`t siplay any messages. But while according to code it should display some values. What is wrong?
|
Wed Apr 25, 2012 12:01 pm |
|
 |
NeXT-Generation
Senior Roboticist
Joined: Wed Sep 28, 2011 10:13 pm Posts: 630 Location: If I told you, I'd have to kill you.
|
 Re: Program doesn`t start after turning brick off and on
Can you post your program? Like this:
_________________A.K.A. inxt-generation Self-proclaimed genius, and future world dominator. My Brickshelf Folder"Don't they teach recreational mathematics anymore?" - The Tenth Doctor Bow down to Nikola Tesla, King of the Geek Gods.
|
Wed Apr 25, 2012 12:05 pm |
|
 |
FosterChip
Rookie
Joined: Wed Apr 25, 2012 11:56 am Posts: 6 Location: Russia, Tomsk
|
 Re: Program doesn`t start after turning brick off and on
Sure, But it`s hard to post it here. It uses few .c files. I have just wrote simple program for testing. This program works great after turning off and on. So, I understand, that this problem depends on program.
|
Wed Apr 25, 2012 12:16 pm |
|
 |
FosterChip
Rookie
Joined: Wed Apr 25, 2012 11:56 am Posts: 6 Location: Russia, Tomsk
|
 Re: Program doesn`t start after turning brick off and on
I really don`t get why it doesn`t work after reboot. My program contains multitasking. It`s a little bit hard for me to explain. This program was written in NXC first. But then I switched to RobotC. So, main task makes orders to another tasks. Such as Sensors, Display, Movement and Control task. There is an array of orders to give. Each task works in while loop waiting for a new order. Sensors read values from each sensor (int this version I have 2 light sensors for line follower) and store them into global variables leftSensorValue and rightSensorValue. Movement task executes the order (order is to follow the line using the PID regulation). For PID regulation I have a special function in another one .c file. Display task erases screen each 100 ms and prints desired information. Code is, Main Task Orders File Global Variables Sensors Movement PidLineFollow (this is exemple code). Anyway, even with empty fucntion problem persists.
|
Wed Apr 25, 2012 12:38 pm |
|
 |
FosterChip
Rookie
Joined: Wed Apr 25, 2012 11:56 am Posts: 6 Location: Russia, Tomsk
|
 Re: Program doesn`t start after turning brick off and on
Well, if immediately turn brick on after turning it off the program still starts and works. But after 10sec waiting it won`t start
|
Wed Apr 25, 2012 1:18 pm |
|
 |
miki
Moderator
Joined: Thu Dec 22, 2011 7:42 am Posts: 43
|
 Re: Program doesn`t start after turning brick off and on
This is more a question than a tip: Does the fact to download a program reset something in the brick ? (something that is not reset by a simple program launch).
Miki.
_________________Visit my project RainBot v0.11 on source forge, a 6 wheels robot featuring A* & Dijkstra's path finding, motors & sensors emulation, small font, fifo & sorted list libraries, using Xander's drivers for HT Compass, and documented with doxygen.
|
Thu Apr 26, 2012 6:07 am |
|
 |
NeXT-Generation
Senior Roboticist
Joined: Wed Sep 28, 2011 10:13 pm Posts: 630 Location: If I told you, I'd have to kill you.
|
 Re: Program doesn`t start after turning brick off and on
Have you tried it on a different NXT? Since your program is in multiple files, could you pleas upload a .zip (or similar) containing them all? I've never heard of a problem like this before.
_________________A.K.A. inxt-generation Self-proclaimed genius, and future world dominator. My Brickshelf Folder"Don't they teach recreational mathematics anymore?" - The Tenth Doctor Bow down to Nikola Tesla, King of the Geek Gods.
|
Fri Apr 27, 2012 3:19 pm |
|
 |
FosterChip
Rookie
Joined: Wed Apr 25, 2012 11:56 am Posts: 6 Location: Russia, Tomsk
|
 Re: Program doesn`t start after turning brick off and on
I`ll try to run this on a different NXT and will tell you the results soon.
|
Sat Apr 28, 2012 3:09 am |
|
 |
miki
Moderator
Joined: Thu Dec 22, 2011 7:42 am Posts: 43
|
 Re: Program doesn`t start after turning brick off and on
Hi FosterChip
Did you try to switch on the option 'zero variables before program starts (n/a VEX)' ? This option is located in 'View' menu, 'RobotC preferences' dialog box then 'Compiler' tab, according that the option 'Super User' is set in 'Window'/'Menu Level'.
Miki
_________________Visit my project RainBot v0.11 on source forge, a 6 wheels robot featuring A* & Dijkstra's path finding, motors & sensors emulation, small font, fifo & sorted list libraries, using Xander's drivers for HT Compass, and documented with doxygen.
|
Mon Apr 30, 2012 11:44 am |
|
 |
FosterChip
Rookie
Joined: Wed Apr 25, 2012 11:56 am Posts: 6 Location: Russia, Tomsk
|
 Re: Program doesn`t start after turning brick off and on
Hi everyone!
Well, I`ve found the source of problem. As you noticed, in task main() I call StartTask function with followint arguments: StartTask(sensors, kDefaultTaskPriority);
So, writing kDefaultTaskPriority was a mistake. Since I deleted this parameter from StartTask function, program works properly after rebooting brick.
It`s interesting that in Multitasking sample program there are return statements at the end of each task. I`ve thought that this is the reason of improper work, but I was wrong.
Thanks for the help!
|
Fri May 04, 2012 4:53 am |
|
 |
miki
Moderator
Joined: Thu Dec 22, 2011 7:42 am Posts: 43
|
 Re: Program doesn`t start after turning brick off and on
Hi FosterChip, I'm glad you found a workaround to this problem  , even if I don't understand how it solves the issue  . The documentation says A reading at first glance suggests that StartTask(TaskID, kDefaultTaskPriority) is the same than StartTask(TaskID);. Another reading of this documentation chapter suggests that if you want to change the priority of a task, you should use StartTaskWithPriority(TaskID, nPriority); rather than StartTask(TaskID, nPriority); But in RobotC v3.08 and fw9.12, this function StartTaskWithPriority(TaskID, nPriority); doesn'exist  So the documentation is obsolete (because StartTaskWithPriority() doesn't exist) and probably false (because it seems that StartTask(TaskID, kDefaultTaskPriority) doesn't behave like StartTask(TaskID)) Would you submit a ticket about that on http://www.robotc.net/support/ with a link on this topic ( posting.php?mode=reply&f=1&t=4470)? Thanks for sharing information. Best regards Miki
_________________Visit my project RainBot v0.11 on source forge, a 6 wheels robot featuring A* & Dijkstra's path finding, motors & sensors emulation, small font, fifo & sorted list libraries, using Xander's drivers for HT Compass, and documented with doxygen.
|
Fri May 04, 2012 7:55 am |
|
|
|
Page 1 of 1
|
[ 11 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
|
|