Implementing a wheel helps you learn how it works, though.
Arduino
Which you can do on paper instead, in less time, and without having to worry about code.
If this is a learning thing, get a good IDE and learn how single-stepping works.
>I'm converting natural numbers to binary numbers
>using mod 2
God damn CS majors are fucking retarded. Use numb&1 or numb^1 to mask out all the bits but the least significant. Then bitshift left by 1 bit, numb, to divide by 2. Also WHY DA FUCK ARE YOU USING FLOOR FOR INTEGER DIVISION! IT ALWAYS FLOORS ALWAYS.
>left
*right
for(int num=0;num=1;
[math]~~~[/math]}
[math]~~~[/math]for(int i=3; i>=0; --i){
[math]~~~~~~[/math]Serial.print(bin[i]);
[math]~~~[/math]}
[math]~~~[/math]Serial.print(' ');
[math]~~~[/math]delay(200);
}
I haven't seen code this confused in quite a while.
int Binarymod[4] = {0,0,0,0};
for (int numb = 0; numb < 16; numb++) {
Binarymod[0] = numb & 1;
Binarymod[1] = (numb >> 1) & 1;
Binarymod[2] = (numb >> 2) & 1;
Binarymod[3] = (numb >> 3) & 1;
for (int i = 3; i >= 0; i--) {
Serial.print(Binarymod[i]);
}
Serial.print(' ');
delay(200);
}
what the fuck is this code
?