mirror of
https://github.com/stasenso/rp_pico_test.git
synced 2026-06-26 21:42:44 +03:00
Grid added
This commit is contained in:
@@ -64,4 +64,22 @@ void draw_bezier(const int *points_x, const int *points_y, size_t num_points, ui
|
||||
// Установка пикселя на экране
|
||||
set_pixel((int)(x + 0.5f), (int)(y + 0.5f), color);
|
||||
}
|
||||
}
|
||||
|
||||
void grid (uint16_t x, uint16_t y, uint16_t step, uint16_t color){
|
||||
for (uint16_t vgrid = x; vgrid < WIDTH; vgrid+=step)
|
||||
{
|
||||
for (uint16_t hgrid = 0; hgrid< HEIGHT; hgrid++)
|
||||
{
|
||||
set_pixel(vgrid,hgrid,reverse(color));
|
||||
}
|
||||
}
|
||||
|
||||
for (uint16_t hgrid = y; hgrid< HEIGHT; hgrid+=step)
|
||||
{
|
||||
for (uint16_t vgrid = 0; vgrid < WIDTH; vgrid++)
|
||||
{
|
||||
set_pixel(vgrid,hgrid,reverse(color));
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -16,5 +16,5 @@ void draw_bezier(const int *points_x, const int *points_y, size_t num_points, ui
|
||||
unsigned short reverse(unsigned short x);
|
||||
void set_pixel(uint16_t x, uint16_t y, uint16_t color);
|
||||
void generate_sine_wave_points(uint16_t num_points, int amplitude, float frequency, int offset_x, int offset_y, float phase_shift);
|
||||
|
||||
void grid (uint16_t x, uint16_t y, uint16_t step, uint16_t color);
|
||||
#endif // __BACKBUFFER_H__
|
||||
@@ -26,6 +26,7 @@ int main() {
|
||||
data = multicore_fifo_pop_blocking();
|
||||
|
||||
fillBufer(frame_buffer,reverse(0x4A69));//
|
||||
grid(20,20,40,0x634d);
|
||||
generate_sine_wave_points(num_points, 50, freq, 0, HEIGHT / 2,x);
|
||||
draw_string(20,110,L"Кириллица работает!!!",0b1111111111111111); //
|
||||
draw_string(50,130,L"Does Latin work?",0b0000000000011111); //Does Latin work?
|
||||
@@ -36,13 +37,13 @@ int main() {
|
||||
{
|
||||
if (freq<=0.0){
|
||||
minmax=false;}
|
||||
else freq-=0.005;
|
||||
else freq-=0.05;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (freq>=10.0){
|
||||
minmax=true;}
|
||||
else freq+=0.005;
|
||||
else freq+=0.05;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user