Go to Post The function of that part is to keep one student occupied playing with it during the entire build season. It doesn't have to be the same student all the time, they can take turns. - MrForbes [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 06-12-2006, 10:23
Qbranch Qbranch is offline
wow college goes fast.
AKA: Alex
FRC #1024 (Kil-A-Bytes)
Team Role: Alumni
 
Join Date: Apr 2006
Rookie Year: 2006
Location: Indianapolis
Posts: 1,174
Qbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond repute
Re: What language do you use?

Robotics: C
General Purpose Embedded: C
Fast Routines: Assembly
School: Java
Calculator: TIbasic and C (yes, there is a compiler)
Quick/Dirty Interfaces and I/O: VB6 (NOT .NET), C++, or QB

-Q
__________________
Electrical Engineer Illini
1024 | Programmer '06, '07, '08 | Driver '08
  #2   Spotlight this post!  
Unread 06-12-2006, 23:17
gobeavs's Avatar
gobeavs gobeavs is offline
linux advocate
AKA: Ross
None #1425 (Wilsonville Robotics)
Team Role: Alumni
 
Join Date: Sep 2004
Rookie Year: 2004
Location: Oregon
Posts: 71
gobeavs will become famous soon enoughgobeavs will become famous soon enough
Send a message via AIM to gobeavs
Re: What language do you use?

Robotics: C
Most other things: Ruby

Learning C# though as a sort of middle-ground.
__________________
"Never in the face of human conflict has so much been owed by so many to so few."
- Winston Churchill on the RAF in WWII
  #3   Spotlight this post!  
Unread 30-12-2006, 04:42
Cjmovie's Avatar
Cjmovie Cjmovie is offline
1293 Resident Hacker
AKA: Christopher Corsi
FRC #1293 (D5 Robotics)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2006
Location: SC
Posts: 73
Cjmovie is a name known to allCjmovie is a name known to allCjmovie is a name known to allCjmovie is a name known to allCjmovie is a name known to allCjmovie is a name known to all
Re: What language do you use?

Robotics: C
Simple Programs: C+ (Yes, C and C++ mixture. If you can call it that)
Complex Programs: C++
Web Development: PHP, SQL (MySQL), XHTML, CSS, Javascript
Low-Level (Such as OS-DEV): x86 ASM
School: Java (which I used to hate with a passion; not so much anymore)

Among other things...
SX Assembly for the SX52 Microcontroller (Crazy thing, 80MHz! You can write a video kernel in it - software black and white NTSC :-) )
And I've experimented with many C-based scripting languages.
__________________
D5 Robotics, Team 1293: Programmer, CAD'er, Mechanical, Electrical... I've made my rounds.
Events: 2006-2009 Palmetto Regional
Website: http://d5robotics.org/
  #4   Spotlight this post!  
Unread 30-12-2006, 04:46
Tom Bottiglieri Tom Bottiglieri is offline
Registered User
FRC #0254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: Jan 2004
Rookie Year: 2003
Location: San Francisco, CA
Posts: 3,186
Tom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond repute
Re: What language do you use?

C#
  #5   Spotlight this post!  
Unread 30-12-2006, 14:06
dcbrown dcbrown is offline
Registered User
AKA: Bud
no team
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Hollis,NH
Posts: 236
dcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud of
Re: What language do you use?

MICRO32 , for low-level h/w bit pushing projects
MACRO32, for assembler level
BLISS for high level...

Of course my first "electronics" class in high school votech did involve 6.3VAC and filaments....

But seriously, any programming language can be used... it is how you use it that counts as long as the resulting run-time execution profile, code size, or data space used doesn't put you at a disadvantage over some other language or tool.

Personally, I always look at the assembler generated by the compiler to see if I'm using things correctly to match the processor architecture. If a line of C code is compiled into 30-40 instructions, then I probably didn't choose the best programming method for solving the problem. For example, in one piece of code I just finished I needed to walk an array and move all the entries up one until some end condition. Putting the code in a loop looked good in C - nice and compact - until I looked at the compiled code. It took some 196 cycles on average to do all the array indexing computations, move the data around, and do end condition check for just 2 array entries with the for loop. In contrast, unwinding the for loop across the whole array

array[0] = array[1];
array[1] = array[2];
...

takes only 64 cycles to always move the whole array even though its like 8-10x more C code. The particular chunk of code started life as a singly linked list structure, but computationally it was just too expensive in terms of compiled code size and execution time. Building a lookaside/ordered index table as a companion to the data structures was much more effecient on the current processor in this case.

The argument of using oop or this or that os is often moot - none of those run very well at all on the current architecture. Moving to a processor that does run linux, say, still doesn't begin to address the issues introduced by using a full blown os; namely no pre-emptive scheduling and very long latency issues in terms of use within a real-time system such as a robot. Yes, there are flavors and changes you can make to get linux to almost be rtos capable, but that typically means either throwing some serious h/w at it or reduction of kernel services to something that means you're really not running linux but some strangled subset there of.

The flip side is learning to program well with an architecture that is both powerful and weak at the same time.

The test of learning to program well is capitalizing on the PICs strengths while recognizing and avoiding its weaknesses as much as possible. If you can do this using some other language or interface - great! Go for it! But for now, I'll stick to C and EasyC as both put me only at a slight disadvantage over assembler if the proper programming method is found and utilized.

Bud

Last edited by dcbrown : 30-12-2006 at 15:00.
  #6   Spotlight this post!  
Unread 30-12-2006, 14:27
cjelly's Avatar
cjelly cjelly is offline
Christopher Jelly
FRC #0177 (Bobcat Robotics)
Team Role: Leadership
 
Join Date: Jan 2006
Rookie Year: 2005
Location: South Windsor, CT
Posts: 29
cjelly is just really nicecjelly is just really nicecjelly is just really nicecjelly is just really nicecjelly is just really nice
Send a message via AIM to cjelly
Re: What language do you use?

For the robot I code in C. Last year, we started a dashboard in VB.NET (that was the main language that my friend and I knew) but eventually converted over to C# after discovering dashboard code that already had most of the work done on it (it was posted on ChiefDelphi somewhere).

Personally, I used .NET for a while, but I found that everything Microsoft makes for development products (that is worth using that is) is very expensive. I do like the express editions of .NET 2.0, but they are somewhat limiting, especially SQL Server Express.

For a job I was doing last year I was forced to switch over to PHP running on an Apache server with a MySQL database backend, and it was so much less restrictive than Microsoft, it was free, and it was more logical I found. I ended up switching my hosting from Microsoft Hosting (on IIS) to Linux Hosting (on Apache).
__________________

Director of Development
  #7   Spotlight this post!  
Unread 03-01-2007, 21:54
Jake M Jake M is offline
void* Jake;
FRC #1178 (DURT)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Missouri
Posts: 118
Jake M has a spectacular aura aboutJake M has a spectacular aura about
Re: What language do you use?

Personally, I always look at the assembler generated by the compiler to see if I'm using things correctly to match the processor architecture.[/quote]

Not to sound like an idiot, but how do you do this? I know assembly language quite well, but I never really found an application for it in practical programming. Is there a way to do this in FRC programming as well?
__________________
Code:
void function(void)
 {
  function();
 }
  #8   Spotlight this post!  
Unread 03-01-2007, 22:13
Astronouth7303's Avatar
Astronouth7303 Astronouth7303 is offline
Why did I come back?
AKA: Jamie Bliss
FRC #4967 (That ONE Team)
Team Role: Mentor
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Grand Rapids, MI
Posts: 2,071
Astronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud of
Re: What language do you use?

Quote:
Originally Posted by Jake M View Post
Not to sound like an idiot, but how do you do this? I know assembly language quite well, but I never really found an application for it in practical programming. Is there a way to do this in FRC programming as well?
Use the list file. It's optionally generated by the linker.
  #9   Spotlight this post!  
Unread 04-01-2007, 12:14
dcbrown dcbrown is offline
Registered User
AKA: Bud
no team
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Hollis,NH
Posts: 236
dcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud of
Re: What language do you use?

In MPLAB IDE, View->Disassembly Listing or View->Program Memory.

If using Program Memory view, I select the "Symbolic" tab at the bottom of the window.

For example,


Code:
void EventHandler_Remove( void )
{
unsigned char ndx;

    for (ndx=0; ndx<MAX_EVENT; ndx++)
    {
	EV_Links[ndx] = EV_Links[ndx+1];
	if (EV_Links[ndx] == 0xFF ) break;
    }
    return;
}
Generates 33 instruction cycles per loop plus 9 instruction cycles of overhead/setup. It could take a maximum of 537 instruction cycles to complete if the event array is full.

Code:
526:                   for (ndx=0; ndx<MAX_EVENT; ndx++)
  6002    6ADF     CLRF 0xfdf, ACCESS
  6004    0E10     MOVLW 0x10
  6006    5CDF     SUBWF 0xfdf, W, ACCESS
  6008    E21D     BC 0x6044
  6040    2ADF     INCF 0xfdf, F, ACCESS
  6042    D7E0     BRA 0x6004
527:                   {
528:               	EV_Links[ndx] = EV_Links[ndx+1];
  600A    28DF     INCF 0xfdf, W, ACCESS
  600C    6AEA     CLRF 0xfea, ACCESS
  600E    0FE0     ADDLW 0xe0
  6010    6EE9     MOVWF 0xfe9, ACCESS
  6012    0E07     MOVLW 0x7
  6014    22EA     ADDWFC 0xfea, F, ACCESS
  6016    50EF     MOVF 0xfef, W, ACCESS
  6018    6EE6     MOVWF 0xfe6, ACCESS
  601A    50DF     MOVF 0xfdf, W, ACCESS
  601C    6AEA     CLRF 0xfea, ACCESS
  601E    0FE0     ADDLW 0xe0
  6020    6EE9     MOVWF 0xfe9, ACCESS
  6022    0E07     MOVLW 0x7
  6024    22EA     ADDWFC 0xfea, F, ACCESS
  6026    52E5     MOVF 0xfe5, F, ACCESS
  6028    50E7     MOVF 0xfe7, W, ACCESS
  602A    6EEF     MOVWF 0xfef, ACCESS
529:               	if (EV_Links[ndx] == 0xFF ) break;
  602C    50DF     MOVF 0xfdf, W, ACCESS
  602E    6AEA     CLRF 0xfea, ACCESS
  6030    0FE0     ADDLW 0xe0
  6032    6EE9     MOVWF 0xfe9, ACCESS
  6034    0E07     MOVLW 0x7
  6036    22EA     ADDWFC 0xfea, F, ACCESS
  6038    50EF     MOVF 0xfef, W, ACCESS
  603A    08FF     SUBLW 0xff
  603C    E101     BNZ 0x6040
  603E    D002     BRA 0x6044
530:                   }
531:                   return;
  6044    D005     BRA 0x6050
This is executed at interrupt time and looks a bit wordy. An alternative is code that does the following:

Code:
void EventHandler_Remove( void )
{
    EV_Links[0] = EV_Links[1];
    EV_Links[1] = EV_Links[2];
    <snip>
    EV_Links[15] = EV_Links[16];
    return;
}


533:                   EV_Links[0] = EV_Links[1];
  6046    C7E1     MOVFF 0x7e1, 0x7e0
  6048    F7E0     NOP
534:                   EV_Links[1] = EV_Links[2];
  604A    C7E2     MOVFF 0x7e2, 0x7e1
  604C    F7E1     NOP
This generates 32 instruction cycles for processing the whole array. So this code has more C code but executes faster than even the minimum 1 time through the arrray using the for loop. Although I can easily read the code and what it is doing, I'm really only interested in instruction counts. If the instructions being generated for each line of C code look a bit high in count, then I usually investigate and possibly re-think what I'm doing based upon how often the code is being executed and how time critical the code is. One of the weaknesses of the PIC18F architecture is array and pointer manipulation - for example - but there are other programming methods of organizing and processing the data to avoid or mitigate those weaknesses.

Bud
  #10   Spotlight this post!  
Unread 05-01-2007, 00:52
something something is offline
Registered User
FRC #1438
 
Join Date: Mar 2004
Rookie Year: 2004
Location: Cypress, CA
Posts: 10
something is an unknown quantity at this point
Re: What language do you use?

C - Robotics
C++ - most x86/x86_64 stuff
assembly - small PIC projects
English - general human interaction

David
  #11   Spotlight this post!  
Unread 08-01-2007, 23:19
drakesword drakesword is offline
Registered User
AKA: Bryant
FRC #0346 (Robohawks)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2004
Location: USA
Posts: 200
drakesword is on a distinguished road
Re: What language do you use?

c & asm -> FIRST
Java -> most complicated projects
Basic 6.0 -> Simple apps for testing purposes
Basic .NET -> Refigned version of above
C++ -> DirectX
LUA -> Gmod (hey its a language)

I would really like to see the Java TinyVM used on the FRC, but thats just a dream.
  #12   Spotlight this post!  
Unread 24-01-2007, 22:03
matt 1923's Avatar
matt 1923 matt 1923 is offline
MATT o.O
AKA: Matt Ragana
FRC #1923 (MiDkNiGhT InVeNtErS)
Team Role: Driver
 
Join Date: Jan 2007
Rookie Year: 2003
Location: new jersy
Posts: 15
matt 1923 is a glorious beacon of lightmatt 1923 is a glorious beacon of lightmatt 1923 is a glorious beacon of lightmatt 1923 is a glorious beacon of lightmatt 1923 is a glorious beacon of light
Send a message via AIM to matt 1923
Re: What language do you use?

  #13   Spotlight this post!  
Unread 24-01-2007, 23:22
AustinSchuh AustinSchuh is offline
Registered User
FRC #0971 (Spartan Robotics) #254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: Feb 2005
Rookie Year: 1999
Location: Los Altos, CA
Posts: 802
AustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond repute
Re: What language do you use?

I use C mostly. I want to learn an interpereted language, but haven't invested the time to learn one. Ruby sounds cool from what my brother has done with it. He created a simulator that takes input from the OI dashboard to drive a robot on the screen rendered with OpenGL.
I also use GTK+ under Linux for graphics.
I have been using latex for typesetting. It is a programing language specifically designed for making nicely formated (math or english) papers which are compiled into pdf and ps files for viewing.
  #14   Spotlight this post!  
Unread 29-01-2007, 02:18
ace123's Avatar
ace123 ace123 is offline
Registered User
AKA: Patrick Horn
FRC #0008 (Paly Robotics - http://robotics.paly.net/)
Team Role: Programmer
 
Join Date: Feb 2005
Rookie Year: 2004
Location: Palo Alto, CA
Posts: 50
ace123 has a spectacular aura aboutace123 has a spectacular aura about
Send a message via AIM to ace123
Re: What language do you use?

I would say Python all the way for an interpreted language.

The other day one of the programmers on my robotics team was asking about how to check if his joystick curve function was working. I was able to rewrite a prototype function in a python editor, stick a for-loop at the bottom the file, and run it, all in about 1-2 minutes (he was still explaining to someone about how it would or wouldn't work when I finished).

The really nice thing about Python is that it has hundreds of *useful* library functions, especially in the string and math realms. It has native BigInt support, and much else.

One problem is that it has no strict typing. This can also be a huge benefit if you are trying to use code intended for one thing for a completely different purpose.

I actually learned python as a scripting language for Vega Strike, but I'm so glad I know it now. Perl feels less "right" than python... too much syntax, and not enough sense to it.

Also, I would say C++ for best compiled language... It has a pretty nice library of functions, it's native, and it runs all C libraries with few hassles. It has some methods for garbage colleciton, and a lot of other features that make it really generous for a compiled language.

Speaking of C++, I've heard Objective-C (I've never used it however) is a nice language (though it hurts my eyes to look at it). It supposedly now has garbage collection support, yet it's compiled. I wonder how they did that...

Java and PHP are okay... but they feel messy. I used to really like PHP for web development, but I learned about Django which is a much more structured web development method written in Python.
__________________
-Patrick Horn, Paly Robotics

Check out the space simulator called Vega Strike, modelled after the space simulator games Elite and Wing Commander. It's Open Source too!
If you have ever played Wing Commander, or especially Privateer, and had a feeling of nostalga derived from the you will enjoy these two Vega Strike mods: Privateer Gemini Gold and Privateer Remake!
I'm working on adding multiplayer support this year...
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
What sensors do you use? StevenB Programming 18 06-04-2006 23:33
Drivetrain, what did you use? maclaren Technical Discussion 42 15-02-2004 21:09
What view do you use? Brandon Martus CD Forum Support 10 02-12-2003 17:32
What do you YOU use your bins for? AlbertW General Forum 40 13-04-2003 04:18
What Foreign language did/are you taking in High School? Tom Fairchild Chit-Chat 34 31-07-2001 21:00


All times are GMT -5. The time now is 18:44.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi