EngineersGarage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise
You are here: Home / Replies / hello..A bit mask is a

hello..A bit mask is a

|

Microcontroller › AVR › what is bit masking????? › hello..A bit mask is a

June 10, 2013 at 8:33 am #9931
Shrikant
Participant

hello..

A bit mask is a variable used with logical operators.

Assuming you want to read the 5th pin of Portb (actually any port)

variable=PINB&(1<<PB5) // where pb5 refers to the 5th pin…PINB is used to read the values of a port

This is your mask.. it stores the value at the 5th pin into the variable

RSS Recent Posts

  • How charging is done in Transformer Inverters June 5, 2026
  • Transistor K2 X T5 June 5, 2026
  • using Swordfish but the matrix fails June 5, 2026
  • Boss Chromatic Tuner TU-3 June 5, 2026
  • Mystery amp noise - ?? June 4, 2026

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2026 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise