Questions tagged as 'byte'

4
answers

How to convert an int to two bytes in C / C ++?

I get the data from a temperature sensor on a microcontroller that has a 10-bit AD converter. I store the data in a variable of type int (of 32 bits), and I need to send this data via serial communication. For this, I need to convert this...
asked by 03.04.2014 / 19:03
5
answers

Is it possible to convert a 16-bit number to a single byte?

If I create the following expression: Int16 numero = 2017; byte m = (byte) numero; m will have the value of 225 . Ok, how do I get 2017 from the byte m (reverse operation) again?     
asked by 17.07.2017 / 19:20
2
answers

How to convert byte to boolean [8] and convert back?

I need to burn some booleans into a file, and then retrieve them. I can write and read one or more bytes with Classes java.io.FileInputStream and java.io.FileOutputStream , so I need to convert 1 byte to an array of 8 booleans,...
asked by 01.07.2017 / 22:15
1
answer

PHP \ xf0 represents 0xF0?

If \xF0 represents a hex as well as 0xF0 , why are their output different? echo "\xF0"; echo 0xF0; I actually do not find any information about this \xF0 notation in the PHP manual.     
asked by 26.10.2018 / 20:06
1
answer

How to read, search and change file by bytes?

Does anyone know how I can find more bytes after I have found the byte sequence of my variable? For example: in the file it will look like this: 6261725610 I'll look for this: byte[] findBytes = { 0x62, 0x61, 0x72 }; and wanted to ret...
asked by 03.07.2015 / 17:03
4
answers

How to concatenate two byte arrays in Java?

I have: byte mensagem[]; byte nonce[]; How do I concatenate the array nonce at the end of the array mensagem and store it in a third array?     
asked by 20.05.2015 / 23:09
2
answers

One character length (ASCII vs. other encodings) in bytes

Viewing this question came up with a question, coming from PHP and in the past having "problems" derived from character encoding, eg: srtpos " vs mb_strpos , I knew that all characters ASCII have 1 byte, but I thought that speci...
asked by 19.01.2017 / 12:11
3
answers

Doubt about IP display of the local network

I'm developing an application to turn off PCs in a lab. I have a reference to class InetAddress , invoking method getLocalhost() . Then I set this to a% byte of% and then I made a array to display the IP in sequence. Howeve...
asked by 17.11.2014 / 13:45
1
answer

Transform int in byte into python

Hello, I need to convert an int value to byte. I tried to do this: import serial ser = serial.Serial('/dev/ttyACM0', 9600) angulo = 90 ser.write(angulo) #while 1 : print ser.readline() I need to send a value to the Arduino, at first,...
asked by 30.05.2017 / 01:48
2
answers

Subtract dates and compare with value

I have two dates: DataAcesso and DataAtual of type DateTime . I have one more field called TempoAtualizacaoAutomatica of typo byte . I need to subtract these dates and compare the result with TempoAtualizac...
asked by 29.12.2014 / 12:47