I need to convert a char array into byte and then ack to an int value that i can read it in my arduino serial monitor. i couldn't figure it out.
void setup(){
Serial.begin(9600);
}
void loop(){
char btes[]={0,0,0,0,0,0,1,1};
byte b=btes[?]; //here is my problem. how do i read the whole array
int numbers=b;
Serial.println(numbers);
delay(100);
}
@Coding Badly please tell me that how can i change the type variable or you can say type casting? I am taking an analog value and wanted to convert into byte. Please tell me ass soon as you can
I am taking an analog value and wanted to convert into byte
An analogue value is normally 10 bits, so won't fit into a byte. You could use "map (analogueValue, 0, 1023, 0, 255);" or more simply "analogueValue >>= 2;"