How to upload Code in a forum thread / Github

How do you upload games to the forum I am completely blind in this case!:frowning:

if you want your code to look like this (easier to understand also), you can refer to the image below

Copy and paste your code in the reply box, and then highlight the code part and click on the </> button :slight_smile:

I was hoping to upload a game to the forum

You’ll need to upload it on Github and then post the link here…

< I don’t know how >

I keep not hitting link
I don’t know how

If you are logged in at Github, click “Start a new Project”
Give it a new Repository name, such as “Codys game” and check the box for Initialize this repository with a README (this is a text file that you can add descriptions)

Once that is done, you are on your projects “Home page”, click create new file and paste your Arduino IDE code in there and save. Remeber to call that file the same as the folder e.g: “Codys Game”
Then you should be ready to save and post the link on the forum!

2 Likes

It fails and comes up like this

What do you mean fail? Is there an error message? Looks pretty okay from your screen photo

I think it is easier to download the Github app, login in the app and press create:

Then, start using that new created folder for your code, directly in the Arduino IDE. After any “considerable” change you may commit your changes (this upload the files, also keeps an history of all your changes). Go to changes, write a reason for the commit and click commit to master and then Sync:

1 Like

…whhaaatt😶 I don’t get it

It does stuff like
Arduboy arduboy;void setup(){}

then that’s an issue with the code you’ve written, not error in uploading it to github…

How about you paste your error message to this thread / or the other thread (whichever is most relevant) by using the </> button and then we can have a look at it

That is because the line ending. If you want to use Github just to upload a file and not “track your changes and all the git benefits” then download notepad++ or notepad2 and change the line endings from Windows to linux or mac:

1 Like
//TEAM STAR 2017
//A GUITAR HERO LIKE CLONE!
#include <Arduboy2.h>
#include <ArduboyPlaytune.h>
Arduboy2 arduboy;
ArduboyPlaytune tunes(arduboy.audio.enabled);

const byte PROGMEM hit [] = { 
0x90,60, 0,31, 0x80, 0x90,61, 0,31, 0x80, 0x90,62, 0,31, 0x80, 0xf0};
const byte PROGMEM point [] = {
0x90,0x30, 0,107, 0x80, 0x90,0x60, 1,244, 0x80, 0xf0};



int points = 0;
int playerx = 70;
int playery = 0;
int playerhieght = 56;
int playerwidth = 1;
int pointx = 15;
int pointy = 31;
int pointhieght = 2;
int pointwidth = 2;
int wally = 56;
int wallx = 0;
int wallhieght = 56;
int wallwidth = 1;
int player2x = 46;
int player2y = 0;
int player2hieght = 56;
int player2width = 1;
int point2x = 7;
int point2y = 20;
int point2hieght = 2;
int point2width = 2;
int point3x = 3;
int point3y = 48;
int point3hieght = 2;
int point3width = 2;
int fastpointhieght = 2;
int fastpointwidth = 2;
int fastpointx = 0;
int fastpointy = 31;
int gamestate = 0;
int logox = 54;
int logoy = 32;

const unsigned char logo[] PROGMEM ={
0x60,0xE0,0xE0,0xE0,0xE0,0xF8,0xFE,0xFF,0xFE,0xF8,0xE0,0xE0,0xE0,0xE0,0x60,0x00,
0xC0,0xF0,0xFD,0x7F,0x7F,0x3F,0x3F,0x1F,0x3F,0x3F,0x7F,0x7F,0xFD,0xF0,0xC0,0x00,



};



void setup()
{
  arduboy.begin();
  tunes.initChannel(PIN_SPEAKER_2);
   tunes.initChannel(PIN_SPEAKER_1);
}
void loop()
{
switch( gamestate )
{
case 0:
arduboy.clear();
arduboy.setCursor(9,9);
arduboy.setTextSize(2);
arduboy.print(F("TEAM STAR"));
arduboy.drawBitmap(logox, logoy, logo, 16, 16, WHITE);
arduboy.display();
if(arduboy.pressed(A_BUTTON))
{
  arduboy.clear();
  gamestate = 1;
}
break;
case 1:
  tunes.initChannel(PIN_SPEAKER_2);
arduboy.setTextSize(1);
if(arduboy.pressed(A_BUTTON))
{
  arduboy.setCursor(0,50);
  arduboy.print(F("Use A To stop DREAMS"));
  arduboy.display();
}
   

   if(!(arduboy.nextFrame()))
   return;
arduboy.clear();
       arduboy.fillRect(point3x, point3y, point3hieght, point3width, WHITE);
      arduboy.fillRect(point2x, point2y, point2hieght, point2width, WHITE);
     arduboy.fillRect(player2x, player2y, player2width, player2hieght, WHITE);
    arduboy.fillRect(playerx, playery, playerwidth, playerhieght, WHITE);
    arduboy.fillRect(pointx, pointy, pointhieght, pointwidth, WHITE);
 
   arduboy.setCursor(4,9);
   arduboy.print(points);
  arduboy.setCursor(0,0);
   arduboy.print(F("TEAM STAR"));
   arduboy.display();
     tunes.initChannel(PIN_SPEAKER_2);
     if(!(arduboy.pressed(A_BUTTON))) 
   {
    fastpointx = fastpointx + 1;
   }
    if(!(arduboy.pressed(A_BUTTON))) 
   {
    point2x = point2x + 1;
   }
    if(!(arduboy.pressed(A_BUTTON)))
   {
    point3x = point3x + 1;
   }
   if(!(arduboy.pressed(A_BUTTON)))
   {
    pointx = pointx + 1;
   }
    if(arduboy.pressed(B_BUTTON)) while(pointx > 70)
    {
      
      tunes.playScore(point);
       
     points = points + 1;
     pointx = 4; 
    }
    if(arduboy.pressed(B_BUTTON)) while(point2x > 70)
    {   
      
       
        tunes.playScore(point);
       
     points = points + 1;
     point2x = 22; 
    }
    if(arduboy.pressed(B_BUTTON)) while(point3x > 70)
    {
     
        tunes.playScore(point);
       
     points = points + 1;
     point3x = 12; 
    }
  
    if(points > 5 )pointx = pointx + 2;
    if(points > 15 )point2x = point2x + 2;
    if(points > 30 )point3x = point3x + 2;
  
    if(points > 100)pointx = pointx + 5;

     if(arduboy.pressed(B_BUTTON)) while(pointx > 56)
    {
      tunes.playScore(hit);
     points = points - 2;
     pointx = 0; 
    }
    

     if(arduboy.pressed(B_BUTTON)) while(point2x > 56)
    {
      tunes.playScore(hit);
     points = points - 2;
     point2x = 0; 
    }
    
     if(arduboy.pressed(B_BUTTON)) while(point3x > 56)
    {
tunes.playScore(hit);
     points = points - 2;
     point3x = 0; 
    }
      if(arduboy.pressed(B_BUTTON)) while(point2x > 70)
    {
        tunes.playScore(point);
     points = points + 1;
     point2x = 22; 
   
    }
    
    if(pointx > 75) pointx = 0;
       if(point2x > 75) point2x = 0;
             if(point3x > 75) point3x = 0;
  
  // This is for a MOD you can do. 
    if(pointx > 130)
    {
      points = points + 1;
    }
}
   
}

This is it normally not it in github😫

Note that that’s not an option for people who don’t have smart phones. For such people there is also Github Desktop.

1 Like

Note that this is for people with 64-bit operating systems

Based on a comment from github desktop’s repo, it seems like less than 3% of github’s desktop users are 32-bit these days which is why they don’t make a 32-bit version.

It might be possible to make a 32-bit version by tweaking the source code though.

And naturally there are other desktop clients for github, or if you’re feeling brave there’s regular old git.