I want to use the potentiometer to provide input to a neural network, so I want to convert the rctime number to a binary number, and then separate it into 1 digit lengths.

For example, say the potmeter gives the rctime value of 323. In binary it would be 0101000011. Then in a format understandable by the neural net, it would be split, literally, into 10 separate digits, i.e. 0, 1, 0, 1, 0, 0, 0, 0, 1, and 1. Each of these would be stored as a variable (or a constant?).

Another example would be the number 700 (around the max of the potmeter). In binary it would be 1010111100. So again, split into 10 digits this would be: 1, 0, 1, 0, 1, 1, 1, 1, 0, and 0.

So the steps pbasic would have to perform would be as follows:

1. Take the number of the current rctime and convert it to binary.

2. Take that binary number and split it into 10 separate digits.

3. Store each of those digits as a variable.

I've been trying to look through the documentation, trying to figure out how to do this. Can anybody help me?

## Bookmarks