I
I
Ilya Pavlov2015-03-21 18:54:53
Arduino
Ilya Pavlov, 2015-03-21 18:54:53

How to write a program for Arduino?

There is an array:

int Values[] = {
  0000001,
  1001111,
  0010010,
  0000110,
  1001100,
  0100100,
  0100000,
  0001111,
  0000000,
  0000100
};

One of the values ​​is taken. It is necessary to execute 7 times (value length)
digitalWrite(/* Здесь порядковый номер(от 0 до 6) */, /* Здесь соответствующее значение(0 или 1) */);

The problem is that it is not possible to take a specific character from the string '0000001'.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Eddy_Em, 2015-03-21
@Eddy_Em

I did not understand, what is this, like binary numbers in an array? But nothing that gcc does not understand them, and indeed such a notation == decimal.
If you need to make lines , then write

char *values[] = {
  "0000001",
  "1001111",
  "0010010",
  "0000110",
  "1001100",
  "0100100",
  "0100000",
  "0001111",
  "0000000",
  "0000100"
};

values[i]will be the address of the i-th line, and values[i][j]is the j-th character in the i-th line.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question