Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

Adafruit_MCP9808.cpp code question
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Adafruit_MCP9808.cpp code question

by jmforem on Sat Aug 29, 2020 5:37 pm

In the .cpp library for the MCP9808 temperature sensor, there is this line in the SHUTDOWN / WAKEUP function-

conf_shutdown = conf_register & ~MCP9808_REG_CONFIG_SHUTDOWN;


What does the tilda do? "~"

Thanks
Erik

jmforem
 
Posts: 6
Joined: Wed May 01, 2019 10:05 am

Re: Adafruit_MCP9808.cpp code question

by adafruit_support_bill on Sat Aug 29, 2020 6:24 pm

The tilda in c++ is the bitwise NOT operator. It inverts the value bit-by-bit:
https://www.tutorialspoint.com/Unary-op ... -Cplusplus

adafruit_support_bill
 
Posts: 79031
Joined: Sat Feb 07, 2009 10:11 am

Re: Adafruit_MCP9808.cpp code question

by jmforem on Sun Aug 30, 2020 8:23 pm

Thank you.

jmforem
 
Posts: 6
Joined: Wed May 01, 2019 10:05 am

Please be positive and constructive with your questions and comments.