Questions tagged [bytes]

A group of binary digits or bits (usually eight) operated on as a unit.

A group of binary digits or bits (usually eight) operated on as a unit.

18 questions
3
votes
1 answer

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, B00000000 }; Now I want to flip a single bit…
gurkensaas
  • 163
  • 1
  • 6
2
votes
0 answers

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 get the information I need. the following code sent…
Damiano Miazzi
  • 151
  • 1
  • 6
2
votes
2 answers

How to convert char[12] to byte[6]

I am trying to convert a char[12] array that contains a Mac Address into a byte[6] in order to use within the Ethernet.begin method. I have tried various methods from online, but had little success to date. The char array currently contains…
BelGaraath
  • 33
  • 4
1
vote
1 answer

Parse char* mac-string to uint8_t array

I have to handle a String coming in over UART containing a bunch of information, part of it is a MAC-address that I get by using String.substring(a, b) returning a 12-char String representing a mac-address "B8C9A45BA770" <- (just an example). I need…
1
vote
3 answers

Set and extract individual bytes of a number (lowByte() and highByte())

You can extract the low-order (rightmost) byte of a variable or the high-order (leftmost) byte of a word with the functions lowByte() and highByte() respectively (the quotes are from the Arduino Reference). Does Arduino provide a way to extract…
LukasFun
  • 295
  • 1
  • 4
  • 17
1
vote
2 answers

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 sensor and use the binary information in given…
1
vote
2 answers

How to modify a created byte?

I have created a byte for 16x2 LCD. It is basically a custom character which I will have to change later. byte char[8]{ B10000, B01000, B00100, B00010, B00001, B11000, B11100 }; I want to edit the third number from fourth row. So, the…
Nouman
  • 217
  • 4
  • 13
1
vote
1 answer

USing arrays, binary data and bitRead

This is my first manually typed code. I'm sure there may be some glaring "schoolboy errors" in it, so wondered if people could give it the 'once over' In particular, I have never used C++ arrays, storing binary data within, and then trying to read…
Cristofayre
  • 11
  • 1
  • 3
0
votes
1 answer

Pass Byte Array to Char and Send to a Separate Arduino

I am trying to send data between Arduino Nano and D1 Mini (ESP 8266 Module) My Code as below in Nano which will be the transmeting , #include #include SoftwareSerial link(2, 3); // Rx, Tx DES des; byte in[8]; String …
VinRocka
  • 145
  • 7
0
votes
2 answers

Arduino Serial Monitor Input 3DES Encryption

I am trying to 3DES encryption using Serial Read, Found this 3DES Sample code in Github, #include DES des; void setup() { Serial.begin(9600); Serial.println("Hello!"); } void loop() { desTest(); tdesTest(); delay(2000); } void…
VinRocka
  • 145
  • 7
0
votes
2 answers

Why float and not 16-bit Integer? Mpu6050 with atmega328P

I've been trying to follow this example code for interfacing my atmega328P with Mpu6050: https://www.instructables.com/Accelerometer-MPU-6050-Communication-With-AVR-MCU/ And was wondering a couple of things. First of all, the sensors on an MPU6050…
0
votes
2 answers

Is there a variable type of half byte? Is there a workaround?

I have this long array of 64 values going from 0 to 15, values which only cost 8 bits, for a pulse width modulation. So I made a test to see its cost in space, commenting one of the two arrays. const byte wave[64] =…
B7th
  • 167
  • 8
0
votes
1 answer

RF24 library commands, channel, and address

I'm trying to use the RF24 library for wireless communication. However, it appeared that this library does not have "help" option. There was a keywords file but it did not explain what it does. I found couple of examples online, and in the…
0
votes
1 answer

Arduino will not read three successive packets in the serial connection

I have written a small program to send serial commands from Python to the Arduino Micro. This is my code for both: Python import serial ser = serial.Serial('COM5', 9600) ser.write(b'0') ser.write(b'1') #…
Greg G
  • 1
0
votes
1 answer

Passing arrays, global arrays within functions, pointers, and declaring array sizes

I'm super confused right about now! I've been working on project involving Xbees in API mode, and I need to send different arrays of bytes to the Xbee depending on which buttons I press. Mostly what I have is working fine, but I'm having a lot of…
AJ_Smoothie
  • 504
  • 4
  • 13
1
2