Playing with binary in Python
While debuging an AVR microcontroller, you need to play with bits. After playing with my calculator I decided to find another way to decode bin/hex etc .. I found a good recipe on ASPN.
Now, this is a little reminder for people (like me) which doesn’t read binary op fluently.
# This will off the bits according to value x &= ~(value) # Here a little reverse: This will set bits on according to value x |= value
Have fun w/ bits :)
- VFD Teaser
- Howto use AVR Dragon Jtag on Linux (Avarice + avr-gdb +DDD)
- Howto recover wrong fuses settings on a AVR
- Nixie clock at home ?
- IV-18 VFD vacuum Russian Clock (part 2)
admin December 15th, 2005
- Misc
- Comments(1)
I’ve used python to generate IO-Port bit patterns for debugging the AVR in the simulator. Helped a great deal to solve some tricky timing issues.