#include "stdio.h"
int value = 2;
int val;
int val1;
int val2;
int val3;
int val4;
int val5;
int val6;
int val7;

int main(void) {
  char stringValue[8]; snprintf(stringValue, 8, "%07d", value);
  
  val1 = (stringValue[0]-48);
  val2 = (stringValue[1]-48);
  val3 = (stringValue[2]-48);
  val4 = (stringValue[3]-48);
  val5 = (stringValue[4]-48);
  val6 = (stringValue[5]-48);
  val7 = (stringValue[6]-48);

  printf("Sensor: %d\n", value);
  printf("\n");
  printf("Vals : %d %d %d %d %d %d %d\n", val1, val2, val3, val4, val5, val6, val7);
  printf("Stringvalue: %s\n", stringValue);
  
  return 0;
}