A noob needs his code checked
1
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!
2
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.
3
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
4
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
5
Name:
Anonymous
2010-12-01 22:11
>>4
Yeah I know it isn't nessesary but my professor wants prototypes for all functions
6
Name:
Anonymous
2010-12-01 23:35
>>5
at least use the correct prototype.
7
Name:
Anonymous
2010-12-02 1:56
(void) considered harmful
8
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
9
Name:
Anonymous
2010-12-02 7:38
back to /g/, ``faggot''
10
Name:
Anonymous
2010-12-02 9:00
>>9
>implying anyone on /g/ knows how to program
11
Name:
Anonymous
2010-12-02 9:24
>>10
`>Please greentext when you imply!
12
Name:
Anonymous
2010-12-02 10:01
>>11
`>implying you don'tGo back to the imageboards, please.
13
Name:
Anonymous
2010-12-02 11:31
>>12
That's right, I'm nowhere close to going back to the imageboards,
``faggot'' .
14
Name:
Anonymous
2010-12-02 13:31
void main (void);
Maximum trolling from the very beginning! I love your style
15
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
16
Name:
Anonymous
2010-12-02 14:29
>>15
Tell your professor that he's full of bullshit and should read K&R.
17
Name:
Anonymous
2010-12-02 14:31
>>16
*YOU* are full of bullshit.
18
Name:
Anonymous
2010-12-02 14:33
>>16
Yeah ok, I have his class in 30 mins so I'll tell him that
19
Name:
Anonymous
2010-12-02 14:55
``Professor Fansworth! That guy on the Internet says you're full of bullshit!''
20
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);
21
Name:
Anonymous
2010-12-02 16:25
>>20
What's wrong with those prototypes?
22
Name:
Anonymous
2011-01-31 20:52
<-- check em dubz