Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

A noob needs his code checked

Name: Anonymous 2010-12-01 20:51

Hey I'm and electrical engineering student so programming is not my forté. I was wondering if someone could check over my code, the purpose is to turn on a red led if a car goes faster than 120 km/h by using two sensors 30m apart.

Here is the link to my code  http://pastebin.com/7dJeKLqh

Thanks for the help!

Name: Anonymous 2010-12-01 21:05

I'm an expert programmer and I can't read your code (despite how simplistic it is). I swear there must be a technique for reading someone's writing.

tl;dr no solutions for you.

Name: Anonymous 2010-12-01 21:19

Yeah pastebin fucked up the commenting, here is a direct link to the file http://db.tt/4HQr92i

Name: Anonymous 2010-12-01 21:51

>>3
not my forté, too...
i think your

void main (void);

prototype isn't necessary
don't know about the rest

Name: Anonymous 2010-12-01 22:11

>>4
Yeah I know it isn't nessesary but my professor wants prototypes for all functions

Name: Anonymous 2010-12-01 23:35

>>5
at least use the correct prototype.

Name: Anonymous 2010-12-02 1:56

(void) considered harmful

Name: Anonymous 2010-12-02 2:48

Made some changes for you, rollcount needs to be reset at a minimum. But the rest depends on how your sensors work.

http://pastebin.com/Tu0XK02i

Name: Anonymous 2010-12-02 7:38

back to /g/, ``faggot''

Name: Anonymous 2010-12-02 9:00

>>9
>implying anyone on /g/ knows how to program

Name: Anonymous 2010-12-02 9:24

>>10
`>Please greentext when you imply!

Name: Anonymous 2010-12-02 10:01

>>11
`>implying you don'tGo back to the imageboards, please.

Name: Anonymous 2010-12-02 11:31

>>12
That's right, I'm nowhere close to going back to the imageboards, ``faggot''.

Name: Anonymous 2010-12-02 13:31

void main (void);

Maximum trolling from the very beginning! I love your style

Name: Anonymous 2010-12-02 14:14

Ok I made some changes to my code here is the new version. http://db.tt/4HQr92i

Oh and ps. I didn't know not to put void infront of main, my professor told me to do it that way

Name: Anonymous 2010-12-02 14:29

>>15
Tell your professor that he's full of bullshit and should read K&R.

Name: Anonymous 2010-12-02 14:31

>>16
*YOU* are full of bullshit.

Name: Anonymous 2010-12-02 14:33

>>16
Yeah ok, I have his class in 30 mins so I'll tell him that

Name: Anonymous 2010-12-02 14:55

``Professor Fansworth! That guy on the Internet says you're full of bullshit!''

Name: Anonymous 2010-12-02 15:22


int main (void);
void math (void);


bad prototype


while(OSSCONbits.IOFS==0)


should be


while(OSSCONbits.IOFS==0);

Name: Anonymous 2010-12-02 16:25

>>20
What's wrong with those prototypes?

Name: Anonymous 2011-01-31 20:52

<-- check em dubz

Don't change these.
Name: Email:
Entire Thread Thread List