Stopwatch demo (VEXcode)

#1

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

12 Likes

#2

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

Edit: With VexCode

0 Likes

#3

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

2 Likes

#4

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

0 Likes

#5

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

#6

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.

0 Likes

#7

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

0 Likes

#8

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.

0 Likes

#9

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

0 Likes

#10

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

1 Like

#11

Obviously you aren’t a neophyte to vocabulary lol.

0 Likes

#12

hopefully you saw the other graphics demo code I released.


1 Like