// Alter the state of a voxel in the cube buffer // This function was made in order to make set and clr versions // of other functions without writing two almost identical functions void altervoxel(int x, int y, int z, int state) { if (state == 1) { setvoxel(x,y,z); } else { clrvoxel(x,y,z); } }
void send_char2(char *char_data) { int8_t l, byte_index; for(l = 7; l >= 0; l--) { for(byte_index = 4; byte_index >= 0; byte_index--) { if(char_data[byte_index] & (1 << (7 - l))) { setvoxel(2 + byte_index, 0, l); } else { clrvoxel(2 + byte_index, 0, l); } } } }