CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

I2C_write (data_l | 0x08); //enable=0 and rs =0

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
czar



Joined: 05 Jan 2020
Posts: 2

View user's profile Send private message

I2C_write (data_l | 0x08); //enable=0 and rs =0
PostPosted: Sun Jan 05, 2020 1:44 am     Reply with quote

I'm working with I2C LCD but don't understand this line, why the | in the parameters of the function I2C_write?
Ttelmah



Joined: 11 Mar 2010
Posts: 19538

View user's profile Send private message

PostPosted: Sun Jan 05, 2020 3:27 am     Reply with quote

| is 'or'.
It's being used here to set bit 3 in the number fed to the write function. Why,
would be a matter of looking at the data sheet for the device involved.
czar



Joined: 05 Jan 2020
Posts: 2

View user's profile Send private message

PostPosted: Sun Jan 05, 2020 9:32 pm     Reply with quote

Ttelmah wrote:
| is 'or'.
It's being used here to set bit 3 in the number fed to the write function. Why,
would be a matter of looking at the data sheet for the device involved.


Thanks Ttelmah!
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group