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

  • factory device from 2017'ish with web ui - too old to function with Microsoft Edge ? January 14, 2026
  • flexible copper cable January 14, 2026
  • renewed interest in old project I call it WICKED 8 January 14, 2026
  • updating circuit with power on off switching January 14, 2026
  • Steering angle sensor question January 13, 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