mirror of
https://github.com/stasenso/rp_pico_test.git
synced 2026-06-26 21:42:44 +03:00
decomposition
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
#include "pico/stdlib.h"
|
||||
#include "DrawBezier.h"
|
||||
#include "font_data.h"
|
||||
|
||||
#include "Reverse.h"
|
||||
int main() {
|
||||
uint16_t red = 0;
|
||||
uint16_t green = 0;
|
||||
@@ -65,23 +65,3 @@ void fillBufer (uint16_t* buffer,uint16_t color){
|
||||
|
||||
}
|
||||
|
||||
unsigned short reverse(unsigned short x)
|
||||
{
|
||||
x = (x & 0xFF) << 8 | (x & 0xFF00) >> 8;
|
||||
return x;
|
||||
}
|
||||
|
||||
void generate_sine_wave_points(size_t num_points, int amplitude, float frequency, int offset_x, int offset_y, float phase_shift) {
|
||||
if (num_points == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
float step = (2.0f * M_PI * frequency) / (num_points - 1);
|
||||
float x_step = (float)WIDTH / (num_points - 1);
|
||||
|
||||
for (size_t i = 0; i < num_points; i++) {
|
||||
int x = offset_x + (int)(i * x_step);
|
||||
int y = offset_y + (int)(amplitude * sinf(i * step + phase_shift)); // Добавлен сдвиг фазы
|
||||
set_pixel(x, y, reverse(0b0000011111100000));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user