As the title says... Chat on...

User avatar
By Patriko
#11961 Hi!

I'm trying to implement bitbang uart and I cannot find any information how to access each bit of byte (in C it's quite simple, for ex. (x>>i)&0x01, but how to do it in lua?

Code: Select all-for(unsigned char i=0; i< DataBitCount; i++)
        if((DataValue>>i)&0x01) //if Bit is high


Thanks,
Patriko