I am coding on uVision 4 in C for a ARM assignment. I can't seem to figure it out but every time I keep on getting the string "536876144".
int main(void) {
int binary[8] = {0,0,0,0,0,0,0,0};//I want this array as integers (for binary terms), therefore i can toggle each number as 1 or 0, corresponding to the input.
char stringbinary[9]; //string for recording the value of the converted integer array
sprintf(stringbinary, "%d", binary);//conversion of the array to string
printf("%s\r\n",stringbinary);//printing the value
.............
.............
if(input=1){
binary[0]=1 - binary[0]; // I have the each value of the array to toggle with activation
}
}
It may just be because I'm tired after hours of coding. I'm pretty sure it's something simple and basic but I just can't seem to find it.