Author Topic: What are you doing with your Beta Shield?  (Read 13187 times)

defragster

  • Sr. Member
  • ****
  • Posts: 467
Re: What are you doing with your Beta Shield?
« Reply #15 on: June 30, 2014, 10:08:15 pm »
there are four switch leads - the thinnest of them all - when I placed mine I watched two - and folded two - pulled and made right and then soldered.  Doing PRO downloads now to see how it goes.

netguy204

  • Newbie
  • *
  • Posts: 20
Re: What are you doing with your Beta Shield?
« Reply #16 on: July 01, 2014, 03:09:54 am »
@wbp @defragster - Correct, not sure how it ever worked for me but the system stack and the enemies/bullets array were interacting.

I've updated the project to make more conservative choices on enemy and bullet array sizes and will eventually go back and tighten up those structures a bit so that more enemies can fit on the pro. The numbers I chose (conservatively) were 15 and 15.

cheetahkid

  • Newbie
  • *
  • Posts: 9
Re: What are you doing with your Beta Shield?
« Reply #17 on: July 01, 2014, 10:20:07 am »
it isn't the button, it the track and yep, PCB track fault with D1 short circuit to 0V under the matrix leds. Looks like no go for me.
(not sure either it need a replacement or repair the track? let me know)
« Last Edit: July 01, 2014, 10:58:52 pm by cheetahkid »

defragster

  • Sr. Member
  • ****
  • Posts: 467
Re: What are you doing with your Beta Shield?
« Reply #18 on: July 01, 2014, 10:44:02 am »
cheetahkid > Interesting to know if all works if you can jumper past it - meaning no other faults on the board.

QUESTION: On power up does the MATRIX go all 6 seconds on for others?  Demo works after that.  If so that would be interesting diagnostic to document.  UPDATE: Mine must go ALL_ON about 90%, but I did get one group where it powered up 'all_off'.  Sometimes it powers up and won't go into run mode - it will sit ALL_ON or all_off.

Good work netguy204.  The device used RAM isn't known to the compiler, but it is there.

« Last Edit: July 01, 2014, 11:03:53 am by defragster »

netguy204

  • Newbie
  • *
  • Posts: 20
Re: What are you doing with your Beta Shield?
« Reply #19 on: July 01, 2014, 10:54:57 am »
@defragster: Sometimes my whole display lights up on power up but it's not consistent.

cheetahkid

  • Newbie
  • *
  • Posts: 9
Re: What are you doing with your Beta Shield?
« Reply #20 on: July 01, 2014, 12:23:12 pm »
I am not sure, using the demo if it all lit up on the matrix that when my switch fault does that.
I tried turn it off by

on part of the demo matrix ...
if(!digitalRead(BUTTON)) {    // This bit I remove the "!" and it will turn off (that with the fault).
    for(int x = 0; x < 8; x++) {
      for(int y = 0; y < 8; y++) {
        lc.setLed(0, x, y, true);
      }
    }

try it to see any different?

I haven't yet to repair my board atm.
« Last Edit: July 01, 2014, 12:25:56 pm by cheetahkid »

defragster

  • Sr. Member
  • ****
  • Posts: 467
Re: What are you doing with your Beta Shield?
« Reply #21 on: July 01, 2014, 12:42:55 pm »
I saw FULL_ON after assembly with factory blink installed.  The first 6 seconds the code isn't running yet (waiting for new program) so this is a hardware power up on the multiplexer etc. - I thought it might have been more deterministic.

Indeed - once the code starts it works right, but as noted I have seen it not always start, sat with all lights on over 5 mins at least once so there is a brownout/race state or something.  Haven't tried without beta shield to see if it is the Pro or the shield at the root of that.

cheetahkid

  • Newbie
  • *
  • Posts: 9
Re: What are you doing with your Beta Shield?
« Reply #22 on: July 01, 2014, 02:30:21 pm »
oh yes that did happen to me sometime, full bright on, when you say brown out, it happens to me when I moved it or touch it (there are pins sticking out in the back and trying not to touch them)... sound like the program isn't complete or working, it will work second try or bring it back to blinker test (use the start program), I don't know how it does that but could be something conflint with usb on computer side, just a guess.
« Last Edit: July 01, 2014, 10:48:48 pm by cheetahkid »

SoLongSidekick

  • Newbie
  • *
  • Posts: 1
Re: What are you doing with your Beta Shield?
« Reply #23 on: July 01, 2014, 06:54:18 pm »
I came here to post this exact thread, and BetaInvaders is AWESOME!! Thanks dude! I've got some ideas, but little Digispark programming experience.

An etch-a-sketch type-thing would be cool. Flashing dot displays where the cursor is, pressing the stick plops a pixel down. Moving the stick obviously moves the cursor around the matrix. Maybe covering the LDR wipes the matrix or something. A snake remake is a pretty obvious one as well.

Robotic motor control would be really cool. Using the stick to either engage lateral motion motors or rotation servos would be perfect for this board. I soldered my LDR just about flush (if not a little above) the upper rim of the LED matrix so I could effectively cover it with a fingertip without having to squeeze down between components. Covering the LDR could decrease speed or acceleration in the motors or something similar.

Other than robotic control this board is pretty useless. I was pretty disappointed when I found out what it was. It's fun no doubt, I guess I was just hoping for something a little more complex. I think I just read into the "Beta" part of it a little too much. I'm realizing it's difficult to power the board with a shield attached; the USB port can't take more than 5.5v and all the power pins aren't easily accessible without soldering to them.

What would be REALLY slick is if it was used to control a robot with an ultrasonic distance sensor that displayed any walls on the matrix so you could have a basic sort of sonar.

defragster

  • Sr. Member
  • ****
  • Posts: 467
Re: What are you doing with your Beta Shield?
« Reply #24 on: July 02, 2014, 01:47:40 am »
Starting with http://pastebin.com/nLutVY1z's source I have extended random thoughts I had from the starting access to everything provided.

I minimized it by taking 100 code lines up to 150 while not adding a single comment! But with a higher light blink factor it uses the same 114 bytes of dynamic memory.

Attach the archived project with a ReadMe.

One Oddity I found is that the X and Y read and run the screen 'relatively' right, but asking for the X or Y input value to use in the code requires moving the wrong axis for these lines:
> BusyWait = ypos;
> RandomFill(xpos);
Maybe I missed news of the X Y axis shift?  But just swapping the joy ports makes the display wrong so it is twisted in the MUX too.
« Last Edit: July 02, 2014, 02:05:37 am by defragster »

digistump

  • Administrator
  • Hero Member
  • *****
  • Posts: 1465
Re: What are you doing with your Beta Shield?
« Reply #25 on: July 02, 2014, 11:43:51 am »
it isn't the button, it the track and yep, PCB track fault with D1 short circuit to 0V under the matrix leds. Looks like no go for me.
(not sure either it need a replacement or repair the track? let me know)

We'd be happy to replace your board/kit if it has a bad PCB - all PCBs are tested at the fabrication company, but sometimes one slips through. If you want a replacement send us an email support at digistump dot com

TravisF

  • Newbie
  • *
  • Posts: 14
Re: What are you doing with your Beta Shield?
« Reply #26 on: July 02, 2014, 12:17:01 pm »
I finally got my board working again and flashed the space invaders game. Wow! That is way better than I would have been able to do. 

defragster

  • Sr. Member
  • ****
  • Posts: 467
Re: What are you doing with your Beta Shield?
« Reply #27 on: July 02, 2014, 09:48:29 pm »
@netguy204 - Code runs for me and the game looks good!  Given the screen size and element counts one byte char variables are good enough for all the data rather than an int.  I also deleted the unused analog read of the Ypos.

I rebuilt swapping the char for int and here is how the upload changes with 24 enemies and 15 bullets:
CHAR:: Sketch uses 3,770 bytes.   Global variables use 247 bytes of dynamic memory.
INT   :: Sketch uses 4,032 bytes    Global variables use 396 bytes of dynamic memory.

Given the 8bit cpu the drop in code size means less overhead doing two byte math.
{ for fun testing I made the enemy bullets kill them when player was hit and it ran game after game! }

netguy204

  • Newbie
  • *
  • Posts: 20
Re: What are you doing with your Beta Shield?
« Reply #28 on: July 03, 2014, 11:32:53 am »
Good call! For some reason I had believed that sizeof(int) == 1 on an 8 bit AVR. All of my code now suddenly takes less memory now that my error is corrected.

Updated the BetaInvaders zip with @defragster's excellent insight (though chose int8_t and uint8_t instead of char to be more overtly explicit.)

netguy204

  • Newbie
  • *
  • Posts: 20
Re: What are you doing with your Beta Shield?
« Reply #29 on: July 03, 2014, 07:33:56 pm »
@SoLongSidekick, you inspired me to create an etch-a-sketch. Thanks for the cool idea!

Ladies and gentlemen, "BetaSketcher!" https://github.com/netguy204/BetaSketcher/archive/master.zip

The cool technical feature of this sketch is that it's using Binary Angle Modulation to actually drive the 8x8 array with multiple simultaneous shades of red. I broke that portion of the code into its own Digispark Pro specific Arduino library called "BAM". The BAM strategy requires the sketch to continuously shift new rows into the MAX 7219 very rapidly. It's Pro specific because it uses the SPI hardware to shift out new values to the matrix as quickly as possible. It also uses the pro's 16 bit timer and compare-match interrupt to keep the display refresh cycle happening in the background while the logic runs in the standard loop() function. The end result is effectively an independent 8 bit software PWM for each individual LED in the matrix. Pretty cool technique!