Pages: 1 [2]   Go Down
Author Topic: bit writer require help  (Read 2212 times)
0 Members and 4 Guests are viewing this topic.
Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 302
Posts: 26336
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Actually was 85 in decimal
So, not 0x55?
Damn.
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Shelby Township, Disco, Michigan
Offline Offline
God Member
*****
Karma: 23
Posts: 739
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Says Who?

Quote
I am trying to create bytes, but i keep getting 28(11100) when im expecting 170(10101010).
The OP is using Decimal and binary, No Hex!

« Last Edit: July 09, 2014, 02:29:59 pm by steinie44 » Logged

Offline Offline
Newbie
*
Karma: 1
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

thank you steinie44 i tested you code and worked well
I cant understand this though
Code:
for (byte i = 7; i < 8; i--)
  {
    bitWrite(b, i, bits[j]);j++;
  }
I understand 'for' with the initialize, test and increment, i just don't know what is happening.

Also how would I change the individual bits without requiring to change everything.
eg. (i didn't know how else to say it)
Code:
if (door is open){
bit3 = 1
}
if(door is closed){
bit3 = 0
}
« Last Edit: August 31, 2014, 06:14:54 am by Onmt39 » Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 302
Posts: 26336
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Code:
bit3 = 1
bitWrite
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Pages: 1 [2]   Go Up
Jump to: