"bit" library - where to find it

Posted by Mudassir Tufail on Mon 31 Oct 2016 04:41 PM — 3 posts, 16,085 views.

#0
Hello

I see bit manipulation functions defined (http://www.mushclient.com/scripts/doc.php?general=lua_bit) however where do I go get the required "bit" libraries?

I have found a i2c LCD driver (lcdprint.lua) which uses functions such as bit.clear / bit.lshift. I am trying to using it esp8266 nodemcu with LUA SDK but it is failing on finding "bit".

Thanks
#1
Never mind - I was able build the Lua SDK (including "bit" library) using https://nodemcu-build.com/index.php.

It works like a charm now :-)
Australia Forum Administrator #2
Also, it would be similar to the source in MUSHclient:

https://github.com/nickgammon/mushclient/blob/master/scripting/bits.c

I added a few functions to it, such as bit_tonumber, bit_tostring, bit_test and bit_clear.