|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
EasyC Wish List
Ok, don't get me wrong - we like EasyC, but...
I'm finding that we're using "User Code" more and more within all the routines being written. So I thought I'd start a wish list for EasyC. 1. Defines with arguments and these showing up in the user functions list. For example: #define SetLeftWheel( _pwm ) SetPWM(2, _pwm) Yeah, we could code a routine called SetLeftWheel() that simply calls SetPWM(), but the call stack isn't that large and we could end up wasting a lot of its stack entries on simple redirection. The define just makes it easier for us to forget which ports/pins/interrupts go together to make up a specific feature on our robot. A feature for Pro mode only maybe? 2. Storage classes/qualifiers for variables. static rom near int lookup[42]={0,8,8,8}; for example. Another Pro only feature? 3. Global "User Code". Currently we need to define a lookup table that is created readonly in program memory. We're using user code to do this and then initializing the array within a routine. The routine then must be called to access an array member. We'd like to be able to put some user code into a global area so the array can be used by more than one routine easily. 4. Cut & Paste support In input boxes and being able to copy out the source lines from the source view window. Or an export function that exports the source lines into a straight text C file. 5. PrintToScreen() We're using hyperterminal so we can save our debug output to a file easier. It needs \r\n at the end of prints to get to the start of a new line. Unfortunately we can enter "Data is %d mgs\r\n" - we'd like to add the %d format character ourselves and then select the variable. Maybe a check to see if a format selection is already present and then just add the variable to the end of the line? Because we can't output multiple variables per PrintToScreen() call, we've been using the following: PrintToScreen( "Data1, Data1, Data3\r\n"); user code[ PrintToScreen( "%d, ", data1 ); ] user code[ PrintToScreen( "%d, ", data2 ); ] user code[ PrintToScreen( "%d\r\n", data3);] Maybe if there was a selection box to enable/disable adding the newline at the end. We print out the data this way so it can be pulled into an excel spreadsheet and charted easily. 6. The ability to use the Ctrl key to add to and accumulate sets of code to cut/delete etc. Select an line item, hold down the Ctrl key and select another line item, etc. 7. A defined upgrade path from EasyC to MPLab. As programmers become more adept and comfortable with programming. They should be able to easily grow from EasyC to MPLab and carry their work with them. This would promote quick prototyping in EasyC but support programmers growth to using MPLab. At the moment the transition is abrupt and you have to start again in MPLab. Maybe an Export Project to MPLab function to create the sources/includes and a template MPLab project or instructions for using the new sources and WPI lib from MPLab. (Ok, I admit it - I tried hacking apart the BDS file to do this but didn't get anywhere other than being able to do some fundamental record breakdown/breakout). I'm sure there might be others. But these are the ones we have at the moment. DCBrown |
|
#2
|
|||||||
|
|||||||
|
Re: EasyC Wish List
Quote:
Code:
#define SetLeftWheel (speed)SetPWM(3,speed) The "functions" would have to be hand entered in user code blocks or in assignment blocks (or any other place an expressions is allowed). Quote:
The next version of EasyC that should be available soon will let you create external functions in MPLab and add them to the linked image. There is already an option to add a header file (.h) so you might try creating those tables in MPLab, then creating a function in the same MPLab module with the "rom" storage class identifier that returns the result to the EasyC program. It sounds like you know how to do this, but if not, post something and we can try to help you out. Quote:
Quote:
Quote:
Quote:
EasyC does not let you select non-contiguous blocks - for that case you need to do multiple select-copy-paste operations. Quote:
Check out the WPILib forum for more information on how to get it and how to use it. There is a 57 page document that describes its use. Last edited by BradAMiller : 24-01-2006 at 09:10. |
|
#3
|
|||
|
|||
|
Re: EasyC Wish List
Quote:
I'm still having problems. I might not fully understand what you are suggesting. I created a .h file of: #ifndef LOOKUP_H int mytable[4] = {1,2,3,4}; #endif #ifdef LOOKUP_H extern int mytable[]; #endif #define LOOKUP_H and did a file inclusion. The problem I've run across is that it must be compiled multiple times into the project. The project won't link, I get multiple defines at link time. If I put an error into the include file I get seven syntax errors. I don't know if that means it is compiled into 7 different modules or not. I could make the table static and that does link cleanly, but that means mytable[] is replicated multiple times in the system. Our real lookup table could be a couple kbytes in size, having this replicated in the system a bunch of times might not be a good thing. Looking for additional guidance. Thanks, DCBrown |
|
#4
|
|||
|
|||
|
Re: EasyC Wish List
Quote:
There is a new version of EasyC that will be availble shortly (by next week, I'd think) that will let you link your programs with an external object file. Then the idea is to create a C source file in MPLab with your table, compile it, and add that object file into the build in EasyC (next version). The table will only be allocated once, since the definition of the table only appears in that object file. Then make your include file only contain an extern for that table and whatever types you need to make it work. That file won't generate any memory since there is only an extern declaration and not the table itself. |
|
#5
|
|||
|
|||
|
Re: EasyC Wish List
Thanks! The new methodology available in the next release sounds a lot cleaner as well as having a lot more applicability including creating a possible migration path between EasyC and MPLab environments for team code.
Can't wait to try out the new version! Regards, DCBrown |
|
#6
|
|||
|
|||
|
Re: EasyC Wish List
Intellitec may may be on the way to robot programming Nirvana if the can have a full expansion path that will take care of the newbies and at the same time allow extensions that will satisfy the experienced programmer. Not there yet but, there is a path.
|
|
#7
|
|||
|
|||
|
Re: EasyC Wish List
Is there a way in EasyC to get the rc_main_batt and rc_backup_batt? These are the field names in the rx data packet under MPLab/ifi default code. I read WPILib and EasyC help but couldn't find anything.
Regards, DCBrown |
|
#8
|
||||
|
||||
|
Re: EasyC Wish List
Quote:
var = GetBackupBattery() var2 = GetMainBattery() |
|
#9
|
||||
|
||||
|
Adding to EasyC Wish List
We make new folders to save working versions of our code. However, if we try to create a folder while saving it is automatically named New Folder and can't be renamed from within EasyC. Please fix this for next year.
|
|
#10
|
||||
|
||||
|
Re: Adding to EasyC Wish List
Quote:
Will do. ![]() |
|
#11
|
||||
|
||||
|
Re: EasyC Wish List
More support for pointers. They can't be initialized like regular variables.
I'd like to be able to grab PWM/relay/digital output values to variables, and I assume pointers would somehow be the way do do so. Is that at all possible now? |
|
#12
|
||||
|
||||
|
Re: EasyC Wish List
Quote:
I defined global constants such as R_DRIVE_PWM and LIMIT_SW_1_INPUT as numbers (3 and 1, in this case). Then I use PWM Control and Limit Switch blocks and select the corresponding constants from the dropdown. It ends up like so: Code:
SetPWM (R_DRIVE_PWM, speed) Code:
sw1 = GetDigitalInput (LIMIT_SW_1_INPUT) |
|
#13
|
|||
|
|||
|
Re: EasyC Wish List
Is it possible to write to any of the other User Bytes [besides User_Byte1 using the SetUserDisplay() function] that are sent back to the OI from the RC using EasyC? Thanks in advance.
|
|
#14
|
||||
|
||||
|
Re: EasyC Wish List
Quote:
You can write any number 0-999 to the OI Display You can also turn on or off the LED's |
|
#15
|
|||
|
|||
|
Re: EasyC Wish List
My biggest wish for Easy-C has nothing to do with the IDE. It's the painfully slow down load that irritated us last Thurs. and Fri. while we working on the ball feeder code. I thought it might be the serial-USB driver but its the same with different chip and drivers. It took a matter of seconds to change the parameters, add a block and move stuff around. It really proved the advantage of a graphic IDE. We could have gotten things debugged much sooner if it wasn't so slow on the down load. Over all I say that Easy-C really did make the programming part of the season easy. Much better than watching the students battle MPLAB all season last year. Thanks intelliteck and First for putting A visual IDE in the kit this year.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Stocking up on parts *wish list | Greg Needel | Technical Discussion | 3 | 13-12-2006 21:28 |
| Dean's Holiday Wish List | DUCKIE | Dean Kamen's Inventions | 5 | 06-12-2006 22:59 |
| 2006 KOP Wish List | Andrew Blair | Kit & Additional Hardware | 33 | 19-05-2006 17:08 |
| FIRST Wish List | Justin Montois | FRC Game Design | 29 | 11-05-2005 15:48 |
| New Regional Wish List | Anne Shade | General Forum | 61 | 28-04-2003 21:48 |