Skip to content

Commit

Permalink
first fluid simulation
Browse files Browse the repository at this point in the history
  • Loading branch information
mitxela committed Nov 26, 2023
1 parent 23d6aeb commit 9833b96
Show file tree
Hide file tree
Showing 3 changed files with 6,007 additions and 3 deletions.
5 changes: 3 additions & 2 deletions candle.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ uint32_t framebuffer[2][ANGULAR_RESOLUTION][ 8 ];
volatile uint32_t period = 0;
volatile bool idle = 1;

#include "fdata-cube-rotate.h"
//#include "fdata-cube-rotate.h"
#include "fdata-liquid.h"

#define SIG_START 1
#define MOTOR_TIMEOUT_MS 250
Expand Down Expand Up @@ -218,7 +219,7 @@ int main(){
if (period > 6250000) pwm_set_gpio_level(MOTOR, 0.9*65535);
else pwm_set_gpio_level(MOTOR, 0.6*65535);

if (++f==24) f=0;
if (++f== sizeof framedata / sizeof framedata[0]) f=0;
load_frame(!active_frame, &framedata[f][0][0]);
active_frame = !active_frame;

Expand Down
2 changes: 1 addition & 1 deletion convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def image_to_bytes(i):
if y == 8:
word &= ~(1<<16)
elif y == 9:
word &= ~(1<<24)
word &= ~(1<<26)
else:
word &= ~(1<<(y+8))
print(f"0x{word:08X}",end = ", " if x<w-1 else "")
Expand Down
Loading

0 comments on commit 9833b96

Please sign in to comment.