Skip to content

Commit

Permalink
double-buffered for fun and profit
Browse files Browse the repository at this point in the history
  • Loading branch information
mitxela committed Nov 26, 2023
1 parent 239fbec commit 23d6aeb
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions candle.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,8 @@ int main(){
//set_voxel(3, 1, 0);
//set_voxel(3, 23, 0);

uint32_t f = 0;//, ft =0;
load_frame(0, &framedata[f][0][0]);
uint32_t f = 0;
load_frame(active_frame, &framedata[f][0][0]);

uint32_t timing = 0;

Expand All @@ -218,16 +218,13 @@ int main(){
if (period > 6250000) pwm_set_gpio_level(MOTOR, 0.9*65535);
else pwm_set_gpio_level(MOTOR, 0.6*65535);

//if (++ft ==3) {
// ft=0;
if (++f==24) f=0;
load_frame(0, &framedata[f][0][0]);
//}
if (++f==24) f=0;
load_frame(!active_frame, &framedata[f][0][0]);
active_frame = !active_frame;

while (gpio_get(IR_SENSOR) == 0) sleep_us(1);



}
}

0 comments on commit 23d6aeb

Please sign in to comment.