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.

Enjoy.

stopwatch

13 Likes

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
        this_thread::sleep_for(10);
    }
}

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

4 Likes

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.

1 Like

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.

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.


1 Like

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.