Laziness is my guess, the time consuming, grueling, and terrible process of attaching code, it’s so painfully long, its like a full minute of my time, despite it causing several minutes of waste and them either not getting the problem solved or they end up posting the code and wasting the first post.
*if you guys couldn’t tell I’m using sarcasm, please always upload code, its not that hard and makes our job a lot easier
6 Likes
void pre_auton(void) {
// Initializing Robot Configuration. DO NOT REMOVE!
#include "vex.h"
using namespace vex;
void drawLogo() {
static const char* imageColors[] = {
"#000000", "#f6c445", "#f9d94b", "#fdf050", "#fdf251", "#f9d84b", "#f8c545", "#fac746", "#f3c244", "#deb13e", "#d7ab3c", "#b69133", "#2c2410", "#080602", "#0e0c05", "#211c0f", "#eebe42", "#cda339", "#362e15", "#463a14", "#a9862f", "#95772a", "#171308", "#e9ba41", "#c19a36", "#e4b53f", "#604f1c", "#584719", "#846d26", "#f3e84f", "#fef462", "#fff652", "#a69f3b", "#fef790", "#fffccb", "#fffde2", "#fef9ae", "#c0b83f", "#ded449", "#ffffff", "#fdf24e", "#d3ca4c", "#fdf576", "#fffef3", "#8e7328", "#6d571e", "#785f21", "#918b32", "#f1f1f1", "#e9df4b", "#b5ad3a", "#3e3e3d", "#e5e5e4", "#818180", "#646020", "#d5d5d0", "#595958", "#7e6624", "#919190", "#fcc946", "#c8bf40", "#b8b8b8", "#6e6e6e", "#a9a9a8",
};
static const int imageIndices[] = {
0, 1, 2, 3, 4, 3, 5, 1, 6, 7, 8, 9, 10, 9, 11, 12, 13, 14, 15, 11, 10, 9, 8, 7, 6, 1, 2, 3, 4, 3, 5, 1, 16, 10, 17, 10, 11, 18, 15, 12, 15, 13, 0, 15, 12, 15, 19, 20, 10, 17, 10, 16, 1, 2, 3, 4, 3, 5, 1, 6, 7, 17, 19, 12, 13, 0, 15, 12, 18, 17, 1, 2, 3, 4, 3, 5, 1, 7, 16, 17, 21, 22, 0, 13, 0, 14, 21, 23, 7, 6, 1, 2, 3, 4, 3, 5, 1, 6, 16, 17, 20, 19, 12, 13, 0, 13, 12, 13, 0, 18, 20, 17, 23, 6, 1, 2, 3, 4, 3, 5, 1, 8, 11, 19, 15, 13, 0, 22, 20, 24, 11, 18, 13, 0, 15, 18, 19, 24, 7, 1, 2, 3, 4, 3, 5, 1, 16, 9, 11, 12, 0, 13, 22, 15, 18, 25, 7, 1, 24, 18, 15, 22, 13, 0, 22, 21, 9, 16, 1, 2, 3, 4, 3, 5, 1, 6, 8, 11, 12, 22, 0, 18, 20, 10, 8, 1, 10, 11, 19, 14, 0, 13, 22, 12, 11, 1, 2, 3, 4, 3, 5, 1, 6, 8, 25, 20, 12, 0, 14, 18, 11, 8, 7, 6, 1, 6, 8,
numbers ect.
46, 13, 0, 12, 24, 7, 6, 23, 18, 0, 22, 20, 7, 1, 2, 3, 4, 3, 5, 1, 6, 24, 14, 0, 19, 10, 1, 8, 10, 22, 0, 12, 24, 6, 8, 25, 18, 0, 13, 26, 17, 6, 1, 2, 3, 4, 3, 5, 1, 6, 24, 14, 0, 15, 26, 46, 26, 13, 0, 22, 27, 46, 45, 22, 0, 22, 20, 7, 1, 2, 3, 4, 3, 5, 1, 6, 24, 14, 0, 22, 20, 6, 1, 2, 3, 4, 3, 5, 1, 6, 24, 14, 0, 22, 20, 6, 1, 2, 3, 4, 3, 5, 1, 6, 24, 14, 0, 14, 26, 17, 6, 1, 2, 3, 4, 3, 5, 1, 6, 10, 46, 57, 17, 8, 1, 0,
};
static const int imageCounts[] = {
960, 144, 1, 1, 224, 1, 1, 62, 2, 2, 1, 1, 1, 1, 1, 1, 1, 9, 1, 1, 2, 1, 1, 3, 1, 160, 1, 1, 224, 1, 1, 62, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 11, 1, 1, 1, 1, 1, 1, 1, 1, 1, 160, 1, 1, 224, 1, 1, 60, 1, 1, 1, 1, 3, 1, 19, 1, 2, 1, 1, 160, 1, 1, 224, 1, 1, 59, 1, 1, 1, 1, 1, 24, 1, 1, 1, 1, 1, 2, 1, 156, 1, 1, 224, 1, 1, 57, 1, 1, 1, 1, 1, 1, 1, 8, 1, 8, 1, 9, 1, 1, 2, 1, 1, 155, 1, 1, 224, 1, 1, 57, 1, 1, 1, 1, 1, 10, 1, 1, 6, 1, 1, 1, 9, 1, 1, 1, 1, 1, 155, 1, 1, 224, 1, 1, 55, 1, 1, 1, 1, 9, 1, 1, 2, 1, 1, 6, 1, 1, 1, 2, 1, 1, 7, 1, 1, 1, 1, 154, 1, 1, 224, 1, 1, 53, 1, 1, 1, 1, 1, 10, 1, 1, 3, 1, 8,
numbers ect
1, 1, 1, 2, 1, 1, 1, 1, 14, 1, 1, 3, 1, 1, 1, 16, 1, 1, 1, 3, 1, 1, 1, 148, 1, 1, 224, 1, 1, 48, 1, 1, 1, 2, 1, 1, 1, 15, 1, 1, 1, 2, 1, 1, 1, 17, 1, 1, 3, 1, 1, 1, 148, 1, 1, 224, 1, 1, 48, 1, 1, 1, 2, 1, 1, 1, 16, 1, 1, 2, 1, 1, 1, 17, 1, 1, 2, 1, 1, 1, 1, 148, 1, 1, 224, 1, 1, 48, 1, 1, 1, 2, 1, 1, 17, 1, 1, 2, 1, 1, 18, 1, 1, 2, 1, 1, 1, 149, 1, 1, 224, 1, 1, 48, 1, 1, 1, 49, 1, 1, 1, 149, 1, 1, 224, 1, 1, 48, 1, 1, 1, 49, 1, 1, 1, 149, 1, 1, 224, 1, 1, 48, 1, 1, 1, 48, 1, 1, 1, 1, 149, 1, 1, 224, 1, 1, 48, 1, 1, 49, 1, 1, 1, 6, 960,
};
int x = 0, y = 0;
for(int i = 0; i < sizeof(imageIndices) / sizeof(imageIndices[0]); ++i) {
int index = imageIndices[i];
int count = imageCounts[i];
if(index >= 0) {
const char* color = imageColors[index];
Brain.Screen.setPenColor(color);
for(int j = 0; j < count; ++j) {
Brain.Screen.drawPixel(x++, y);
if(x >= 480) { x = 0; y++; }
}
} else {
x += count;
while(x >= 480) { x -= 480; y++; }
}
}
}
// All activities that occur before the competition starts
// Example: clearing encoders, setting servo positions, ...
}
you seem to have the drawLogo() function inside the pre_auton function, can’t do that, move it outside.
1 Like
Where would that go.
You need to move the function drawLogo() to be in front/before the pre_auton function. You can’t nest the functions the way you are doing.
3 Likes
Did moving the code work?
It crashes my Chromebook everytime any fix
Hi. Did you read the posts in this thread?
PLEASE POST YOUR CODE.
Its the website when I upload the image