#include <QCoreApplication>
#include <QDebug>
int main(int argc, char *argv[])
{
QCoreApplication a (argc, argv);
unsigned char VEL_LEFT = 0;
VEL_LEFT = VEL_LEFT | 100;
QString packet;
packet.push_back (QChar (VEL_LEFT));
qDebug () << "VEL_LEFT: " << VEL_LEFT;
qDebug () << "packet: " << packet;
return a.exec();
}
The intention here is to manipulate 8 bits by ORing or ANDing them, and then storing them in a string.
Then I would like to read the output as decimal.
Output of this program is:
VAL_LEFT: 100
packet: "d"
What is "d" here?