theziz / ev3c Goto Github PK
View Code? Open in Web Editor NEWC library for using the sensors and actors of mindstorms using ev3dev
License: GNU General Public License v2.0
C library for using the sensors and actors of mindstorms using ev3dev
License: GNU General Public License v2.0
The LED functions are not working with the most recent ev3dev version
I have found a bug in src/ev3c_lcd.c because of that rectangle frames which aren't squares are only half-drawed (that means, the line below and right aren't drawed).
I found the reason of this bug: in line 258, 264, 273 and 279 are the variables w
and h
(width and height) interchanged.
The fixed ev3_rectangle_lcd_out
is:
void ev3_rectangle_lcd_out(int32_t x,int32_t y,int32_t w,int32_t h,int32_t bit)
{
int32_t a;
int32_t minx = x;
int32_t miny = y;
int32_t maxx = x+w;
int32_t maxy = y+h;
if (minx >= (int32_t)EV3_X_LCD)
return;
if (miny >= (int32_t)EV3_Y_LCD)
return;
if (maxx < 0)
return;
if (maxy < 0)
return;
if (minx < 0)
minx = 0;
if (miny < 0)
miny = 0;
if (maxx >= EV3_X_LCD)
maxx = EV3_X_LCD-1;
if (maxy >= EV3_Y_LCD)
maxy = EV3_Y_LCD-1;
if (bit)
{
if (y == miny)
for (a = minx; a <= maxx; a++)
EV3_PIXEL_SET(a,miny);
if (y+h == maxy)
for (a = minx; a <= maxx; a++)
EV3_PIXEL_SET(a,maxy);
if (x == minx)
for (a = miny+1; a <= maxy-1; a++)
EV3_PIXEL_SET(minx,a);
if (x+w == maxx)
for (a = miny+1; a <= maxy-1; a++)
EV3_PIXEL_SET(maxx,a);
}
else
{
if (y == miny)
for (a = minx; a <= maxx; a++)
EV3_PIXEL_UNSET(a,miny);
if (y+h == maxy)
for (a = minx; a <= maxx; a++)
EV3_PIXEL_UNSET(a,maxy);
if (x == minx)
for (a = miny+1; a <= maxy-1; a++)
EV3_PIXEL_UNSET(minx,a);
if (x+w == maxx)
for (a = miny+1; a <= maxy-1; a++)
EV3_PIXEL_UNSET(maxx,a);
}
}
Remark that if (y+w == maxy)
is changed to if (y+h == maxy)
and if (x+h == maxx)
is changed to if (x+w == maxx)
.
The motor support is not working. Furthermore the motor test application crashes.
Is this project still alive?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.