Git Product home page Git Product logo

ev3c's People

Contributors

lungj avatar theziz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

ev3c's Issues

Fixing LED

The LED functions are not working with the most recent ev3dev version

Bug in ev3c_lcd.c (with fix)

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).

Fixing motor support

The motor support is not working. Furthermore the motor test application crashes.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.