Is it possible to use Java to control a PIC?

Do you have a technical question that doesn't really fit a specific console? Want some general info on electronics, hacking, making cookies, etc? Here's the place to ask! Go nuts.

Moderator: Moderators

Post Reply
User avatar
joevennix
Portablizer
Posts: 999
Joined: Sat Jan 14, 2006 9:34 am
Location: On permanent vacation from reality.
Contact:

Is it possible to use Java to control a PIC?

Post by joevennix » Thu Sep 21, 2006 9:06 am

I know most PICs use C or Basic, but can you program it in Java? I'm learning Java this year, and am interested in using PIC's for some small projects
Image

User avatar
timmeh87
Senior Member
Posts: 3047
Joined: Mon Nov 14, 2005 10:19 pm
Location: Ontario, Canada

Post by timmeh87 » Thu Sep 21, 2006 12:42 pm

ive never heard of one, but a quick search turned up this...

http://www.muvium.com/

not exactly a compiler i dont think.


C isnt that hard to learn, and you can get free C compilers (ahem).
Image

"Linux is only free if your time is worthless"

User avatar
joevennix
Portablizer
Posts: 999
Joined: Sat Jan 14, 2006 9:34 am
Location: On permanent vacation from reality.
Contact:

Post by joevennix » Thu Sep 21, 2006 1:30 pm

Once I learn Java, do you think it'll be easier to learn C? I dont really have time to learn C right now. Also, how hard is it to apply C to PICs? I've heard varying reports, some people think BASIC is easier.
Image

User avatar
timmeh87
Senior Member
Posts: 3047
Joined: Mon Nov 14, 2005 10:19 pm
Location: Ontario, Canada

Post by timmeh87 » Thu Sep 21, 2006 2:31 pm

ha. well I dont know Java, and havent used pic Basic...

but once you know any language, you know all the basic princples (for loops, do loops, if...then statements, arrays, functions, number systems) and any other language is easier to learn - you just have to learn the syntax.

c is pretty easy in my opinion. its very structured what with all the brackets and semicolons. you dont need to know much to get thigs done. for example, here is a board with a pic thats flashing some lights, and the C code that runs it

http://www.youtube.com/watch?v=FZgFQWmVmW0

Code: Select all

#include <16f877.h> 
#use delay (clock=20000000)  //20Mhz

void main(void){
int x;
do{
	x++;                    //increment x
	delay_ms(50);           //wait 50msec
   output_b(x);            //put x onto port B
  }while(true);            //forever
}
Image

"Linux is only free if your time is worthless"

Post Reply