Stopwatch demo (VEXcode)

Now that VEXcode is released and has the latest SDK I can finally release the stopwatch demo I wrote over a year ago.




Is it now possible to display an image from the micro-SD card as well as using the buffer?

Edit: With VexCode

yes, very simple. You need the update to 1.0.6, that fixed a small bug in the png library, then all you need is

/*                                                                            */
/*    Module:       main.cpp                                                  */
/*    Author:       james                                                     */
/*    Created:      Fri Mar 22 2019                                           */
/*    Description:  V5 project                                                */
/*                                                                            */
#include "vex.h"

using namespace vex;

// A global instance of vex::brain used for printing to the V5 brain screen
vex::brain       Brain;

// define you global instances of motors and other devices here

int main() {   
    Brain.Screen.drawImageFromFile( "V5-Brain-small.png", 0, 0 );
    while(1) {
        // Allow other tasks to run

to be able to display this image from SD Card (as long as you give it the name V5-Brain-small.png)


any way to get the png on the sd card connected on the brain without sneaker net? that would be a nice feature (says the guy who has the good sd card at school, but no adapters there etc… ugh!!! )

No, it’s more complicated than it appears, but essentially the user code cpu has exclusive access to the SD Card. The USB and all other comms is handled by the vexos cpu.


think “you’re not the boss of me” impediments schools might face with their district IT department…

(and please, can we call VEXcode preview v1 … otherwise, IT groups might not let “beta software” installed.

1 Like

Does this work for .png files without a background? I can make your function work , but I am having trouble with my image.

If the question is “do we support png transparency” then no, we do not support the png alpha channel or images with a transparent background.


Ok, Thanks for the update. I Will keep that in mind!

That’ s really cool! I’m glad that you released the code so that us code neophytes can figure it all out.

1 Like

Obviously you aren’t a neophyte to vocabulary lol.

hopefully you saw the other graphics demo code I released.


how did you make the HEX array of the image? did you make your own program to do so? Or did you use other sources that can be used online? I am interested in putting an image on the screen.

Hi, I was wondering how you got that nice image of your brain screen. Is there a screen capture for v5 brain or something?

Hey @trexing123! A lot of people on the forum dislike “necroposting” aka “reviving old threads”. Most people think that you shouldn’t reply on threads that haven’t been posted on for over 3 or 4 months. Just something to keep in mind. To answer your question, I believe that there were developer tools that the original developers of the V5 system could use to test code, one of those being a simulator for the V5 screen that could run on a computer (Example of that here). Since JPearman had access to those tools (since he works for Vex or Robomatter or something like that) he probably just did a screenshot on whatever computer he was using at the time. There is not a screen capture feature for the V5 brain (although I have to admit, it sounds like a cool idea).


yea, it was done using development tools we use for documentation and things like that, however, you can also do a screenshot using the pros command line tool. Perhaps one day it will also get integrated into VEXcode.