It is currently 22 Apr 2018 13:33

All times are UTC + 1 hour




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: 14 Feb 2018 21:47 
Offline

Joined: 21 Jul 2016 23:16
Posts: 5
I have 8 bits for inputs.

var I_1 : sbit at PORTB.4;
var I_2 : sbit at PORTB.5;
var I_3 : sbit at PORTB.6;
var I_4 : sbit at PORTB.7;
var I_5 : sbit at PORTA.0;
var I_6 : sbit at PORTA.1;
var I_7 : sbit at PORTA.2;
var I_8 : sbit at PORTA.3;


I would like to use them in one byte.
Is there a way to do this?
Sure I can to wite something like

var byte8 : Byte;
byte8.0 := I_1.0;
byte8.1 := I_2.0;
// and so on


But I have pain on my eyes.

Is there any good way to do?


Top
 Profile  
 
PostPosted: 14 Feb 2018 22:25 
Offline

Joined: 18 Feb 2006 13:17
Posts: 4892
bigbo wrote:
Is there any good way to do?
No. sbit declaration assigns only another name to the same bit, it doesn't form new bit variable, so there's no way to 'collect' the hypothetical bit variables.

_________________
Replacement libraries for mP PRO and PIC18 processors, mP PRO tips & trics


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 4 guests


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 post attachments in this forum

Search for:
Jump to: