Questions tagged [bit]
A bit (short for binary digit) is the smallest unit of data in a computer. A bit has a single binary value, either 0 or 1. Although computers usually provide instructions that can test and manipulate bits, they generally are designed to store data and execute instructions in bit multiples called bytes.
30 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
0
votes
1
answer
79
views
Why is char being "extended" to an int?
I know I'm missing something so simple here, but I can't figure it out.
If I do char letter = 'A'; then letter = letter << 8, letter = 0, as one should expect, since we are shifting the bits &...
3
votes
1
answer
199
views
changing a single bit in an arduino EEPROM byte
In my code I have a number of boolean flags that tell me if data has been written to specific places in the EEPROM. I need to save these flags to the EEPROM and recover them on a restart.
Is the ...
2
votes
0
answers
377
views
Modbus RS485 Decode the message received
I'm try to read some value from a soil NPK sensor using RS485 Modbus e Arduino uno.
I menage to sent the request msg and I got the response but now i don't know how to read the response in order to ...
1
vote
2
answers
85
views
Bitwise Operator in Arduino Code Question
What is the below Arduino code doing?
I am not familiar with the '+' with regard to bitwise operations. Just getting familiar with this stuff.
return ((four << 0) & 0xFF) + ((three << ...
1
vote
1
answer
136
views
Do these bit settings all mean the same?
ADMUX = ADMUX | _BV(REFS); // uncompounded bitwise OR
ADMUX |= _BV(REFS0); // #define _BV(bit) (1 << (bit))
ADMUX |= bit(REFS0); // #define bit(b) (1UL << (b))
bitSet(...
1
vote
1
answer
160
views
Why is there a cutoff on these accelerometer measurement values? - ADXL375
I'm using a Teensy 3.2 to read data from an ADXL375 using SPI. In general the communication is going just fine and I can activate settings etc.
However, when I try to read X, Y or Z data it seems like ...
3
votes
1
answer
3k
views
Changing single bit in byte array
So I have a byte-array representing the display attached to my Arduino:
byte theDisplay[8] = {
B00000000,
B00000000,
B00000000,
B00000000,
B00000000,
B00000000,
B00000000,
...
-1
votes
2
answers
94
views
5-bit communication method?
OK, I'm working on a project where I want to have multiple toggle switches create a "code" to determine further actions. This is essentially 5-bit communication process that will create ...
2
votes
2
answers
975
views
How to control Shift registers output individually bitwise
so i am working on a project which needs a lots of bit manipulation and shifting out the bits to control the pins of shift registers individually.
So i am using 2 shift registers daisy chained with 16 ...
1
vote
1
answer
168
views
Writing to partially reserved registers of sensors
I'm trying to change the range of a gyroscope I'm using and there is the following guideline:
it is recommended to mask out
(logical and with zero) reserved bits of registers which are partially ...
0
votes
1
answer
469
views
Controlling LEDs with bit bang method
I'm doing a research for RGB LED chips that MCU can control with one pin. I found this LED chip and it seems controlling LEDs is not as I've tought. I understand hardware part, software side is a ...
3
votes
2
answers
499
views
Form a signal from an array of bits
I need to reproduce with a digital pin of an Arduino such a key in the form of a sequence of 1's and 0's, where a one takes 2 ms high and 2 ms low, and a zero takes 1 ms high and 1 ms low.
int key =...
1
vote
1
answer
730
views
Print 2 numbers stored in 24-bits in decimal format
An implementation function from the nice little Wiegand library YetAnotherArduinoWiegandLibrary prints a hexadecimal representation of a facility # & card # (8-bit facility #, 16-bit card #) — 24 ...
1
vote
2
answers
4k
views
LSB/MSB and shiftOut
Here is the shiftOut function code from wiring_shift.c
void shiftOut(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder, uint8_t val)
{
uint8_t i;
for (i = 0; i < 8; i++) {
...
1
vote
2
answers
543
views
need to compare if a byte is less than 80 hex
I am using an infrared sensor called OTI301. In its data sheet it says that in order to obtain object temperature and ambient temperature values I need to extract the binary information from the ...