increment bits

A

ashtonn

Hello,

How do i manipulate arrays to increment 8 bits at a time.

I need to generate a pattern like
01,02,03,.....0xFF

Thanks,
-Ashton
 
B

Bill Mill

Hello,

How do i manipulate arrays to increment 8 bits at a time.

I need to generate a pattern like
01,02,03,.....0xFF
[hex(n) for n in range(256)]
['0x0', '0x1', '0x2', '0x3', '0x4', '0x5', '0x6', '0x7', '0x8', '0x9', '0xa', '0
xb', '0xc', '0xd', '0xe', '0xf', '0x10', '0x11', '0x12', '0x13', '0x14', '0x15',
'0x16', '0x17', '0x18', '0x19', '0x1a', '0x1b', '0x1c', '0x1d', '0x1e', '0x1f',
<snipped>
'0xe8', '0xe9', '0xea', '0xeb', '0xec', '0xed', '0xee', '0xef', '0xf0', '0xf1',
'0xf2', '0xf3', '0xf4', '0xf5', '0xf6', '0xf7', '0xf8', '0xf9', '0xfa', '0xfb',
'0xfc', '0xfd', '0xfe', '0xff']

Peace
Bill Mill
bill.mill at gmail.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Arduino Chess Clock 1
array concatenation 0
atomic increment 4
Javascript programming in TheThingsNetwork 1
simpler increment of time values? 5
Incrementing Values 1
print values from Py_BuildValue 2
SHA 256 5

Members online

Forum statistics

Threads
474,239
Messages
2,571,199
Members
47,834
Latest member
KristianEn

Latest Threads

Top