SiNe DeMo - A small demo showing sine calculation

As member of TEAM a.r.g. this is our very first demo.

You’re free to contribute and make the demo bigger, better, showing what can be done with Arduboy

first video:

TEAMarg Demo webpage:
http://www.team-arg.org/demos.html

github:

6 Likes

In file Sine-DeMo.ino, I’d move everything between “void loop() {” and “while (1) {” to the end of the “setup()” function, following “arduboy.display();”. You then wouldn’t need to have the rest of the code in a “while (1)” loop. Just let “loop ()” repeat it for you.

True … but it is not part of the Setup either (in the strict sense of the word). This just shows you can have things in the loop executed only once and others continuously.

I disagree. Having a while (1) loop, containing no break or other means of exit, nested directly under loop(), just adds an extra level of indent. Anything before the while (1) could go in setup(). Anything after the while (1) would never be executed.

In the Arduino world, I see setup() as being for anything that only runs once at the beginning, not just setup and initialisation things.

loop() is called loop because it’s for things that are repeated continuously. It’s expected that at some point, the end of the loop will be reached and start again at the beginning.

I can’t express enough likes: a demo scene is perfect for the arduboy. I love it.

Well it is a github : ) Make a PR! (although I’m the same way, the time it takes to get rollin on that is sometimes prohibitive)

I’m already on GitHub, so it wouldn’t take much effort. But the change is simple and the author has been made aware of the suggestion. In this case, it would probably be simpler for @JO3RI to just make the change directly to the master, if desired.

1 Like

Point taken, will do !

I say, if the result is the desired result, no need to change the code. i think they animation looks beautiful. Obviously JO3RI knows what he is doing.

2 Likes

This is amazing!!! Nice work can’t wait to see it on an actual developer unit :wink:

1 Like

You have really made your own Arduboy Developer Kit ! :smile:
Good work, I can’t wait to see what TEAM a.r.g can do with the real Arduboy.

1 Like

I’m getting an error compiling this demo: ‘B11111111’ and others were not declared in this scope. I’m using Arduino 1.6.5. How do I fix?

2 Likes

I had the same error - so I just changed all of the binary values in bitmaps.cpp to hex values:

const unsigned char PROGMEM LetterH[] = {
  0xFF,
  0xFF,
  0x18,
  0x18,
  0x18,
  0xFF,
  0xFF,
  0x00
};

const unsigned char PROGMEM LetterE[] = {
  0xFF,
  0xFF,
  0xDB,
  0xDB,
  0xDB,
  0xC3,
  0xC3,
  0x00
};

const unsigned char PROGMEM LetterL[] = {
  0xFF,
  0xFF,
  0xC0,
  0xC0,
  0xC0,
  0xC0,
  0xC0,
  0x00
};

const unsigned char PROGMEM LetterO[] = {
  0xFF,
  0xFF,
  0xC3,
  0xC3,
  0xC3,
  0xFF,
  0xFF,
  0x00
};

const unsigned char PROGMEM Letter[] = {
  0x00,
  0x00,
  0x00,
  0x00,
  0x00,
  0x00,
  0x00,
  0x00
};

const unsigned char PROGMEM LetterG[] = {
  0xFF,
  0xFF,
  0xC3,
  0xD3,
  0xD3,
  0xF3,
  0xF3,
  0x00 
};

const unsigned char PROGMEM LetterA[] = {
  0xF8,
  0xFE,
  0x37,
  0x33,
  0x37,
  0xFE,
  0xF8,
  0x00
};

const unsigned char PROGMEM LetterR[] = {
  0xFF,
  0xFF,
  0x09,
  0x09,
  0x19,
  0xFF,
  0xF6,
  0x00
};

const unsigned char PROGMEM LetterB[] = {
  0xFF,
  0xFF,
  0xC9,
  0xC9,
  0xC9,
  0xFF,
  0x76,
  0x00
};

const unsigned char PROGMEM LetterY[] = {
  0x0F,
  0x1F,
  0xD8,
  0xD8,
  0xD8,
  0xFF,
  0xFF,
  0x00
};

const unsigned char PROGMEM LetterD[] = {
  0xFF,
  0xFF,
  0xC1,
  0xC1,
  0xC1,
  0xFF,
  0x7E,
  0x00
};

const unsigned char PROGMEM LetterU[] = {
  0x7F,
  0xFF,
  0xC0,
  0xC0,
  0xC0,
  0xFF,
  0x7F,
  0x00
};
1 Like

Thanks @uXe, I fixed the code @rcsportpilot on github

1 Like

Thanks - it compiles for me now.

From now on, this demo works for both ARDUBOY and DEVKIT.

You can use the board.txt way to set you desired device (or change it in Arglib.h)
Default is ARDUBOY

1 Like