I created a git repo with tests and this is the function we got to get it working:
module.exports = function rotate(value) {
var rotated = value >> 1;
// Check to see if the first bit was set...
if (1 & value) {
//...flip the furthest bit on.
rotated += (1 << 7);
}
return rotated;
};
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
I created a git repo with tests and this is the function we got to get it working: