TinyCircuits

Recent Posts

Pages: [1] 2 3 ... 10
1
Tiny Arcade / game developing tutorial for tiny arcade won't work
« Last post by bobojo on May 23, 2017, 02:45:07 PM »
I did everything it said ,but after trying to upload the file is said "too many initializers for 'ts_sprite'"
here is my code:

//Tiny Arcade Testing
//Initiated Mon. 5/22/17 @  10:05pm
//    Updated Mon. 5/22/17 @  10:06pm

const uint16_t ALPHA = 0x1111;

#include <TinyScreen.h>
#include <Wire.h>
#include <SPI.h>
#include "TinyArcade.h"
#include "GameTutorialSprites.h"

TinyScreen display = TinyScreen(TinyScreenPlus);

typedef struct {
  int x;
  int y;
  int width;
  int height;
  const unsigned int *bitmap;
} ts_sprite;

ts_sprite ball = {44,28,4,4,0,ballBitmap};

int amtSprites = 1;
ts_sprites * spriteList[1] = {&ball};

int backgroundColor = ts_16b_Black;

void setup() {
  arcadeInit();
  display.begin();
  display.setBitDepth(TSBitDepth16);
  display.setBrightness(15);
  display.setFlip(false);

  USBDevice.init();
  USNDevice.attach();
  SerialUSB.begin(9600);
}
void loop() {
  drawBuffer();
}

void drawBuffer(){
  unit8_t lineBuffer[96 * 64 * 2];
  display.startData();
  for(int y = 0; y < 64; y++)  {
    for(int b = 0; b < 96; b++)  {
      lineBuffer[b*2] = backgroundColor >> 8;
      lineBuffer[b*2+1] = backgroundColor;
    }
    for(int spriteIndex = 0; spriteIndex < amtSprites; spriteIndex++){
      ts_sprite *cs = spriteList [spriteIndex];
      if (y >= cs->y && y < cs->y + cs->height)  {
        int endX = cs->x + cs->width;
        if(cs->x <96 && endX > 0)  {
          int xBitmapOffset = 0;
          int xStart = 0;
          if (cs->x < 0) xBitmapOffset -= cs ->x;
          if (cs ->x >0) xStart = cs->x;
          int yBitmapOffset = (y- cs->y) *cs-> width;
          for (int x = xStart; x < endX; x++) {
            unsigned int color = cs->bitmap[xBitmapOffset + yBitmapOffset++];
            if (color != ALPHA)  {
              lineBuffer[(x)*2] = color >> 8;
              lineBuffer[(x) * 2 +1] = color;
            }
          }
        }
      }
    }
    display.writeBuffer(lineBuffer,96 * 2);
  }
  display.endTransfer();
}
2
Tiny Arcade / Re: Ideas for the Tiny Arcade
« Last post by Swimgirl195 on May 22, 2017, 08:36:59 PM »
In addition to tiny-man there should be tiny snake! Eventually most of the classic arcade games should be created. I'm definitely looking forward to writing my own. In a different thread I posted the possibility of new sticker skin designs for the arcade. And the capability of the TinyArcade to keep record of the player's high-scores would be really nice!
3
New Product Ideas / TinyArcade: skins, history boards
« Last post by Swimgirl195 on May 22, 2017, 08:31:29 PM »
Heyo,

New to the community here, looking forward to writing games for the arcade soon! So I've two ideas at the moment:

Perhaps when the arcade has picked up even more popularity there could be the possibility of having new sticker skin designs? Not a priority but just an idea.

Second is the possibility of adding a high-score table to the games that come preloaded with the arcade. Or some kind of application that could be downloaded where the player's high scores could be saved to the arcade.

That is all for now folks, thanks!
4
TinyDuino / Re: Sierra driver
« Last post by tripleequal on May 22, 2017, 01:44:49 AM »
This still seems to be an issue. Im unable to get any USB connection on Sierra
5
TinyDuino / Serial does not become ready
« Last post by dblewis76 on May 20, 2017, 08:36:37 PM »
Using the TinyDuino, two motor driver cards, and ribbon cable card in one stack and ribbon cable card and USB card at the other end of the cable. Download a very simple Serial sketch and the serial device does not become ready so if I print something it is garbage. Garbage is output at the 4 second rate in the attached sketch.
6
Do you know how to write data to SD card with TinyArcade?
I want to save game data with SdFat library but I will fail by mistake.
If Sample.txt exists on the SD card, only 1st succeeds. 2nd will fail.
If Sample.txt does not exist, both 1st and 2nd will fail. zero byte Sample.txt is created.


#include <TinyScreen.h>
#include "SdFat.h"

TinyScreen tiny_screen = TinyScreen(TinyScreenPlus);
SdFat sd_fat;
int write_bytes1 = -1;
int write_bytes2 = -1;

void setup()
{
   // Initialize SD card
   sd_fat.begin(10, SPI_FULL_SPEED);
   // Initialize screen
   tiny_screen.begin();
   tiny_screen.setBitDepth(TSBitDepth8);
   tiny_screen.setBrightness( 8 );
   tiny_screen.setFont(liberationSansNarrow_12ptFontInfo);
   tiny_screen.fontColor(TS_8b_White, TS_8b_Black);
   // Write file 1st
   SdFile file1;
   if(file1.open("Sample.txt", O_RDWR | O_CREAT))
   {
      char text[128];
      sprintf(text, "123456 text");
      write_bytes1 = file1.write(text, 12);
      file1.close();
   }
   // Write file 2nd
   SdFile file2;
   if(file2.open("Sample.txt", O_RDWR | O_CREAT))
   {
      char text[128];
      sprintf(text, "654321 text");
      write_bytes2 = file2.write(text, 12);
      file2.close();
   }
}

void loop()
{
   char text[128];
   sprintf(text, "1st %dbytes", write_bytes1);
   tiny_screen.setCursor(0, 0);
   tiny_screen.print(text);
   sprintf(text, "2nd %dbytes", write_bytes2);
   tiny_screen.setCursor(0, 14);
   tiny_screen.print(text);
}
7
TinyDuino / PIXY + TinyDuino
« Last post by Bullwinkle on May 11, 2017, 02:19:25 PM »
Has anyone successfully interfaced a PIXY camera board with a TinyDuino OR TinyScreen?
If so, what libraries are compatible, and is there any example code available?
I don't need video frame rate processing; relatively long-interval still image is fine; the
PIXY seems like it ought to be reasonably straightforward, as it has I2C interface (and others).
Thanks for any insights!
Jim
8
TinyDuino / Load battery without USB Board
« Last post by maxouille on May 09, 2017, 04:44:21 AM »
Hi everyone !

I wonder if it's possible to load battery without usb board. I would like to add an extra micro-usb connector (https://www.sparkfun.com/products/12035) in order to move the loading slot. Moreover, I want to power up another device with the TinyDuino Processor board without code in it. The processor board would act as a battery controler.

Can I load the battery by connecting the micro-usb board onto the pins under the processor board ? These pins are located under the micro-JST connector.

Thanks
9
TinyDuino / Re: Getting Watch tutorial working with latest BLE boards
« Last post by Ben Rose on May 03, 2017, 07:24:57 PM »
Really sorry- we had a miscommunication here and started shipping with ST boards before the watch code example was finished, and we haven't received any questions through email support so I was not aware of it. We might not have the new code published for a week or more. It's definitely an option for us to ship you a Nordic BLE board- please send an email to info@tinycircuits.com if so.

Thanks,
Ben
10
TinyDuino / Re: "Motor driver not detected!" ??
« Last post by Ben Rose on May 03, 2017, 07:13:30 PM »
This was resolved through support, but if there's a fourth motor output, it's our old 4x motor driver and needs different software compared to the dual motor driver :)
Pages: [1] 2 3 ... 10