GDR Forum Index
Podcast Podcast
Dev Dev Logs
Search Search
RSS RSS
Register Register
Log in Log in
Reply to topic GDR Forum Index -> Game Developer's Refuge -> Arduino and Microcontroller Fun Times Page 1, 2  Next
View previous topic :: View next topic  
Author Message
PoV
Moderator

Joined: 21 Aug 2005
Posts: 10892
Location: Canadia
PostPosted: Sun Dec 14, 2014 8:04 pm    Post subject: Arduino and Microcontroller Fun Times Reply with quote

I think I mentioned in the off-topic thread that I bought some various Arduino's (Microcontroller+Boards) for fun.


I got started by hacking the Blink Demo: http://arduino.cc/en/Tutorial/Blink?from=Tutorial.BlinkingLED

I figure there's no point saving the code, so here's a copy+pastes.


The first is just a basic hack of the Blink. Made it double flash and delay.

Code:
// Pin 13 has an LED connected on most Arduino boards.
// give it a name:
int led = 13;

// the setup routine runs once when you press reset:
void setup() {               
  // initialize the digital pin as an output.
  pinMode(led, OUTPUT);     
}

// the loop routine runs over and over again forever:
void loop() {
  digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(100);
  digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
  delay(100);
  digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(100);
  digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
  delay(700);
}



Next one I decided to be clever and wired up 3 LEDs, and made them blink one after the other.

Code:
// the setup routine runs once when you press reset:
void setup() {               
  // initialize the digital pin as an output.
  pinMode(13, OUTPUT);     
  pinMode(11, OUTPUT);     
  pinMode(10, OUTPUT);     
}

// the loop routine runs over and over again forever:
void loop() {
  digitalWrite(13, HIGH);
  digitalWrite(11, LOW);
  digitalWrite(10, LOW);
  delay(300);               // wait for a second
  digitalWrite(13, LOW);
  digitalWrite(11, HIGH);
  digitalWrite(10, LOW);
  delay(300);               // wait for a second
  digitalWrite(13, LOW);
  digitalWrite(11, LOW);
  digitalWrite(10, HIGH);
  delay(300);               // wait for a second
}



Finally, I wanted to get smooth fades of each LED by PWM modulating each one by a SIN curve. I'm clipping the curve at zero, so it's more like the upper half of the curve.

I didn't care that much, so I hacked the math to slow it down (should be angle * 2.0 * PI, but whatever).

Code:
// the setup routine runs once when you press reset:
void setup() {               
  // initialize the digital pin as an output.
  pinMode(13, OUTPUT);     
  pinMode(11, OUTPUT);     
  pinMode(10, OUTPUT);     
}

float angle = 0;
float HalfPI = PI * 0.5f;

// the loop routine runs over and over again forever:
void loop() {
  angle += 0.01f;
 
  int a1 = (int)max(sin((angle+0.0f)*1.0*PI)*255,0.0);
  int a2 = (int)max(sin((angle+HalfPI)*1.0*PI)*255,0.0);
  int a3 = (int)max(sin((angle+PI)*1.0*PI)*255,0.0);
 
  analogWrite(13, a1);
  analogWrite(11, a2);
  analogWrite(10, a3);
  delay(20);
}


_________________
Mike Kasprzak
'eh whatever. I used to make AAA and Indie games | Ludum Dare | Blog | Tweetar
View user's profile Send private message
PoV
Moderator

Joined: 21 Aug 2005
Posts: 10892
Location: Canadia
PostPosted: Sun Dec 14, 2014 9:02 pm    Post subject: Reply with quote

You'll have to click the speaker this time. We're doing audio.

Code:
// the setup routine runs once when you press reset:
void setup() {               
  // initialize the digital pin as an output.
  pinMode(13, OUTPUT);     
}

float angle = 0;
float HalfPI = PI * 0.5f;

// the loop routine runs over and over again forever:
void loop() {
  angle += 0.01f;
 
  int a1 = (int)((sin(angle*angle*2.0*PI)*127)+128);
 
  analogWrite(13, a1);
  delay(20);
}




Here are a few more audio tests. I did not grab the source code.


I was trying to get Bytebeats to play and sound (almost) the same as they do on PC.

This one, I believe I was using PCM mode (analogWrite as above) to use the generated ByteBeat value as Pulse Width. Not quite correct. I later found out my timing may have been wrong too.



This one, I'm getting closer. It was down to understanding the timing, and I think I had just started modulating high<->low the individual bits in digital mode (digitalWrite).


_________________
Mike Kasprzak
'eh whatever. I used to make AAA and Indie games | Ludum Dare | Blog | Tweetar


Edited by PoV on Mon Dec 15, 2014 9:20 am; edited 1 time
View user's profile Send private message
PoV
Moderator

Joined: 21 Aug 2005
Posts: 10892
Location: Canadia
PostPosted: Sun Dec 14, 2014 9:52 pm    Post subject: Reply with quote

Mostly got 8000 Hz Bytebeat's playing.

Code:
// the setup routine runs once when you press reset:
void setup() {               
  // initialize the digital pin as an output.
  pinMode(13, OUTPUT);     
}

int t = 0;

// the loop routine runs over and over again forever:
void loop() {
  t++;
 
//  int a1 = ((t >> 10) & 42) * t;
//  int a1 = t*(((t>>9)^((t>>9)-1)^1)%13);
  int a1 = ((  (t>>7|t|t>>6)*10+4*(t&t>>13|t>>6)  ) & 255) / 127 - 1;

  for( int idx = 0; idx < 8; idx++ ) {
    digitalWrite(13,a1&1 ? HIGH : LOW);
    delayMicroseconds(4);
    a1 >>= 1;
  }
}



That's pretty much all I was looking to get working today.

My Audio Circuit was an old PC speaker, and a 100 Ohm resistor. On the back of the PC speaker it says 8 Ohms, 0.3 Watts. According to my math, a 100 Ohm resistor made the 5v output of the Arduino in to 0.25 Watts.


Things I need to look in to some day:
- Interrupts (not sure if they exist).
- Inputs (Digital and Analog)
- Analog Output (I've PCM, which is sort of like Analog, but is Frequency Modulation not Amplitude Modulation).

These Ardiuno's are pretty easy to use. Write simple C code, plug the device in to a USB port, upload the code.
_________________
Mike Kasprzak
'eh whatever. I used to make AAA and Indie games | Ludum Dare | Blog | Tweetar


Edited by PoV on Mon Dec 15, 2014 9:12 am; edited 1 time
View user's profile Send private message
PoV
Moderator

Joined: 21 Aug 2005
Posts: 10892
Location: Canadia
PostPosted: Mon Dec 15, 2014 9:10 am    Post subject: Reply with quote

So I actually ordered both an Arduino Leonardo and a fake Arduino (Seeeduino Lite). The fake (a clone really) requires that you solder the connectors to the board.



Not the greatest soldering job, I'll admit.



That last pin on the 4-pin grove connector, heh, yeah.


Anyways, one driver install later, it works EXACTLY like the Arduino Leonardo (you even select the Leonardo inside the Ardiuno software).

So I installed my bytebeat noisemaker above.



Success.
_________________
Mike Kasprzak
'eh whatever. I used to make AAA and Indie games | Ludum Dare | Blog | Tweetar
View user's profile Send private message
Sirocco
Moderator

Joined: 19 Aug 2005
Posts: 9453
Location: Not Finland
PostPosted: Mon Dec 15, 2014 3:10 pm    Post subject: Reply with quote

I have a friend who wants to do an Arduino project for a temperature-controlled process. That reminds me I really need to get back with him on that and see what it'd take. Looks like it'd be a lot of fun.
_________________
NoOP / Reyn Time -- The $ is screwing everyone these days. (0xDB)
View user's profile Send private message Visit poster's website
PoV
Moderator

Joined: 21 Aug 2005
Posts: 10892
Location: Canadia
PostPosted: Mon Dec 15, 2014 9:42 pm    Post subject: Reply with quote

I'm having a ball. Microcontrollers, Commodore 64, Nintendo homework, it's such a nice feeling doing something FOR FUN for a change.

I waste way too many brain cells on trying to create viable sell-able game products, telling myself I'd play later.

F*ck it.

Dead Retro Game Machines, and things that can cause fire. Zero commercial potential. That's my jam.
_________________
Mike Kasprzak
'eh whatever. I used to make AAA and Indie games | Ludum Dare | Blog | Tweetar
View user's profile Send private message
PoV
Moderator

Joined: 21 Aug 2005
Posts: 10892
Location: Canadia
PostPosted: Thu Dec 18, 2014 10:22 am    Post subject: Reply with quote

I need to learn this stuff:

http://www.ruggedcircuits.com/10-ways-to-destroy-an-arduino/

How to destroy an Microcontroller by incorrectly shorting pins.

(I mean, I have to learn this so I don't do it. Not so I can destroy MC's, but that'd be nice to know too)


I found this to be a good article explaining Diodes.

https://learn.sparkfun.com/tutorials/diodes

More:
https://learn.sparkfun.com/tutorials/resistors
https://learn.sparkfun.com/tutorials/capacitors
https://learn.sparkfun.com/tutorials/transistors

https://learn.sparkfun.com/tutorials/shift-registers
http://bildr.org/2011/08/74hc595-breakout-arduino/ (more on Shift Registers)

https://learn.sparkfun.com/tutorials/voltage-dividers

https://learn.sparkfun.com/tutorials/analog-to-digital-conversion
https://learn.sparkfun.com/tutorials/pulse-width-modulation

https://learn.sparkfun.com/tutorials/light
https://learn.sparkfun.com/tutorials/light-emitting-diodes-leds

Communication:
https://learn.sparkfun.com/tutorials/serial-communication
https://learn.sparkfun.com/tutorials/serial-peripheral-interface-spi
https://learn.sparkfun.com/tutorials/i2c

https://learn.sparkfun.com/tutorials/ir-communication

Really, Sparkfun has an excellent library of information.
_________________
Mike Kasprzak
'eh whatever. I used to make AAA and Indie games | Ludum Dare | Blog | Tweetar
View user's profile Send private message
PoV
Moderator

Joined: 21 Aug 2005
Posts: 10892
Location: Canadia
PostPosted: Thu Dec 18, 2014 3:06 pm    Post subject: Reply with quote

I might be addicted. ;)


I just made a large parts order from China (AliExpress). This time I bought actual fake Arduinos (well, clones).

I was going to claim that Arduinos are already cheap, but up until now I've been ordering everything from China, during Black Friday sales (i.e. extra cheap).


My initial order was from Seeedstudio, a company I discovered some 5 years ago when they were selling a cheap ($80) digital oscilloscope. Apparently they became quite a serious hobbyist electronics store since then (with some pretty great deals during sales).

http://www.seeedstudio.com/depot/category_products?themes_id=1414

I should probably mention that the Arduino Uno is the original Arduino, and the Arduino Leonardo is the newer/generally better one. There are advantages to both, and there are a few minor pinout differences, but they are effectively the same. When we talk fakes or clones, they are pinout and software compatible with one of the official models.

Regular Price for an Uno or Leonardo seems to be $25-$30. I paid $10 each for two Leonardo's, and $17 for a Seeediuno Lite (Leonardo clone). Going in to it, I didn't know that it was a Leonardo clone, but I am glad it is. As mentioned in posts above, I had to solder the connectors on myself.

I'm still waiting on 2 more packages from them, notably included is a Seeeduino Lotus (got it on sale for $13, reg $18). According to the Wiki it's a UNO clone, so that'll be my first UNO, as everything I currently have are Leonardo's.


Today's order included Chinese copies named after the originals. Specifically I was looking for a deal on an Arduino Nano, a physically smaller version of the UNO (when 2 inches by 2 inches is too big). Apparently regular price is $45 for these (!?), but from China, just a mere $4. (They're probably discontinued, hence the high price)

http://www.aliexpress.com/store/group/For-Arduino/1185416_254803293.html

If you buy them in bulk (sets of 5 or 10), they cost less than $3 each (~$2.50 at 10). Or if you're feeling especially crazy, you can buy just the chip for ~$1 each.

...

I did make a big order, but instead of buying a lot of Nano's, I took advantage of their crazy-cheap prices, and bought a variety of devices.

- Arduino Nano clone for $4 [reg $45 (wtf)]
- Arduino Micro clone for $6 [reg $25] (like a Leonardo in a Nano form factor).
- Arduino Uno clone for $4 [reg $28]
- Arduino Mega clone for $11 [reg $45] (better Microcontroller, more pinouts)
- Arduino Leonardo clone for $8 [reg $25]

The goal was to have 1 of each, so I could try them out. And though I (effectively) already have 3 Leonardo's, I wanted one of the China clones to compare quality.

They have an Arduino Due clone for $18 [reg $55] (like a Mega but with an ARM CPU), but I wanted to keep the order around $40. In the same order I also grabbed a cheap LCD screen for UNOs (and hopefully Leonardos too), and a break-out shield for the Nano.

I did say the order was big. Actually I made 4 small orders from a few different Chinese manufacturers (Aliexpress is like a bunch of eBay stores). The Arduinos were the 1st order.

Two of the other orders were for bulk parts. Hundreds of resistors, LEDs, diodes, capacitors and buttons; A few dozen blank boards you can soldier things to; A lot of male and female pin headers (connectors), both straight and right angle; A lot of 16-pin sockets, and some of those headers you can use to basically make any sized sockets; And finally some Integrated Circuits. 30 shift register chips (3 pins to 8 pins, daisy chain-able), and 20 decoder chips (3 pins to 8 pins).

Finally, the last order were a bunch of cheap LCD screens. A 7" IPS screen with a breakout board and HDMI connector, a small LCD with a Raspberry Pi pinout, and a generic small LCD with pinouts on top.

Aside from the Arduino's and the LCD's, nearly everything cost like $2-$3. So when I say I bought 100 push-buttons, I paid like $3 for them. So it's a large order of lots and lots of very inexpensive things.

Total was ~$140. About $40 in Ardiunos and Add-on boards, $50 in LCD screens, and $50 in parts. :)



All of this started the other day, when I tried to find a really really cheap small LCD screen that could take HDMI. The Beagelbone, one of the device I bought alongside the Raspberry PI's, I wanted something I could plug it in to and test with. It was a pain to plug the HDMI in to my workstation, since it meant unplugging the PlayStation 3. So I wanted something portable.

The best+cheapest HDMI option I could find is a bit clumsy, but interesting.

http://www.aliexpress.com/store/product/7-inch-Raspberry-Pi-IPS-LCD-With-HDMI-VGA-AV-Screen-Display-Module-For-Pcduino-Banana/1196030_32254114213.html

Includes the raw 7" IPS screen and a controller board you can plug in to, for $29. It lacks a case, which might be troublesome, but it's worth a try for under $30. All the options with cases cost $50+.


Anyways ya, toys.
_________________
Mike Kasprzak
'eh whatever. I used to make AAA and Indie games | Ludum Dare | Blog | Tweetar
View user's profile Send private message
PoV
Moderator

Joined: 21 Aug 2005
Posts: 10892
Location: Canadia
PostPosted: Sat Dec 27, 2014 10:11 pm    Post subject: Reply with quote

Just want to make a list of what else exists.

Chipkit Uno32 - PIC Microcontroller Arduino Clone - 80Mhz, 128k Flash, 16k SRAM, 42 I/O Pins
http://www.digilentinc.com/Products/Detail.cfm?NavPath=2,892,893&Prod=CHIPKIT-UNO32
More Chipkit Boards: http://www.digilentinc.com/Products/Catalog.cfm?NavPath=2,892&Cat=18

TI Launchpad - TI MSP Microcontroller (Texas Instruments) - 25 MHz, 128k Flash, 8k RAM, 40 I/O Pins (?)
http://www.ti.com/ww/en/launchpad/launchpad.html
$13 - http://www.seeedstudio.com/depot/TI-MSP430F5529-USB-LaunchPad-p-2189.html

Papilio One 256k, 512k - Xilinx FPGA Arduino Clone (fully programmable) - 48 I/O Pins
http://papilio.cc/ http://papilio.cc/index.php?n=Papilio.Hardware
256 for $37: http://www.seeedstudio.com/depot/Papilio-One-250K-p-809.html
512 for $64: http://www.seeedstudio.com/depot/cubietech-m-66.html?ref=side ($50 on sale at homepage)
Pro version has an FPGA simulated SID sample for download

MBED - ARM Microcontroller Arduino Clones - Various configurations
http://developer.mbed.org/platforms/
Cheap $11 board - http://www.seeedstudio.com/depot/NUCLEO-F401RE-Development-Board-for-STM32-p-1933.html

LinkIt One - ARM Microcontroller Proprietary Arduino Compatible - 260 MHz, 16 MB Flash, 4 MB RAM
https://labs.mediatek.com/site/global/developer_tools/mediatek_linkit/hdk_intro/index.gsp
About $79: http://www.seeedstudio.com/depot/LinkIt-ONE-p-2017.html

Maple, Maple Mini - ARM Microcontroller (precursor to MBED) - 72 MHz, 128k Flash, 20k RAM, 43 I/O Pins, bad IC2 support, EOL but still manufactured
http://leaflabs.com/docs/hardware/maple-mini.html
Mini Clone for $5 (Original on Sparkfun): http://www.aliexpress.com/item/leaflabs-Leaf-maple-mini-ARM-STM32-compatibility/1400667476.html

Banana PI - Allwinner A20 ARM SOC (Raspberry PI Clone) - Dual Coretx A7 at 1GHz CPU, MALI 400MP2 GPU, 1 GB RAM, 6 I/O Pins
http://www.bananapi.org/p/product.html
About $50 from China. http://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20141227222219&SearchText=Banana+PI

Cubieboard - Allwinner A20 ARM SOC - basically the same thing as Banana PI, various models
http://cubieboard.org/model/
About $64: http://www.seeedstudio.com/depot/cubietech-m-66.html?ref=side

Cubieboard 4 (CC A80) - Allwinner A80 ARM SOC - Eight Coretex A15, PowerVR G6230 GPU (OpenGL ES 3.0), 2 GB RAM
http://cubieboard.org/model/cb4
About $125: http://www.seeedstudio.com/depot/Cubie-Singleboard-Computer-Octa-core-A80-p-2157.html

Beagelbone.
_________________
Mike Kasprzak
'eh whatever. I used to make AAA and Indie games | Ludum Dare | Blog | Tweetar
View user's profile Send private message
PoV
Moderator

Joined: 21 Aug 2005
Posts: 10892
Location: Canadia
PostPosted: Sun Jan 04, 2015 12:46 am    Post subject: Reply with quote

I've been asked a few times what project I'm planning to do with the Arduinos I bought, and I really didn't have an answer (can't you buy one and not have a a project?).

That said, I think I figured out what I want to do: a C64 1541 floppy to USB adapter.

Long story short, I have a alot of C64 floppy disks that I'd like to back up. I do have a 1541 to Parallel adapter, but almost nothing has a parallel port anymore. I'd like something I can just plug in to USB, in to any machine.

* * *

I did a quick search for DIN port adapters, but I think I'm just going to chop a Commodore 64 serial cable in half. I acquired a whole bunch of these some years back, just in case.

Once all my parts from China arrive, I should be able to rig up a socket that plugs in to the Arduino headers using a solder prototype board, and then if I pair it with one of the cheaper Arduino I'll have something semi permanent. I suppose it could even be designed for a Mini of Micro, making it quite tiny (socket plus port/serial end).

Effectively, I should be able to make it using less than $10 in parts.

Sounds like fun. :)

* * *

On a related note, it seems the joysticks used by the Commodore 64, Atari, and similar systems are outrageously simple. It is literally one pin per direction of the joystick, one pin for fire, and ground. I found a random video on YouTube of some dude that used a serial port header and more or less directly wired it to the Arduino. I am tempted to try this out as well, just to have done it.

Technically, I already have adapters for converting Commodore 64 joysticks to USB, but it would be nice if I could do that myself.
_________________
Mike Kasprzak
'eh whatever. I used to make AAA and Indie games | Ludum Dare | Blog | Tweetar
View user's profile Send private message
PoV
Moderator

Joined: 21 Aug 2005
Posts: 10892
Location: Canadia
PostPosted: Sun Jan 04, 2015 2:05 am    Post subject: Reply with quote

Doing some homework on serial communication protocols.

The Commodore 64, Atari, Sega Master system, Sega Genesis, TurboGrafx 16 all use raw pin data for pressed buttons. The Sega Genesis uses a selector pin for extra buttons. The TurboGrafx 16 uses a selector pin for extra controllers. All of these can be easily attached directly to an Arduino to capture input.

The Nintendo, Super Nintendo, PlayStation, and most pre-USB controllers use serial communications. This usually means they need only three pins (Clock, Latch, Data), and ground, but a power pin is often included (5 total). Obviously, the protocols used don't necessarily conform to the standard serial RS-232 protocol that PCs used, but are generally the same idea. Most controller serial protocols are absolute bare bones, simply returning a sequence of buttons states immediately after latching.

USB uses 2 pins and something called NRZI (Non-Return to Zero, Inverted) to encode the data, and the pins fluctuate low to high (D- is low when D+ is high, and vice versa). The protocol is very straightforward, despite the confusing name. The pins pulse low high low high as long as the signal is one, but doesn't change if it's zero.

http://www.wildpackets.com/resources/compendium/fast_ethernet/signal_nrzi
http://www.beyondlogic.org/usbnutshell/usb2.shtml

Behind USB there is a whole set of standard protocols, packets that do things, like TCP or UDP networking. Each device is assigned an ID, and is a slave to the PC. When I want to know something, I'll ask for it.

The only part of USB I don't really understand, is how it does its clock. NRZI makes sense, but then what? Especially given that USB is capable of communicating at several speeds (mainly old and new USB versions), how do we synchronize and understand we're part of the USB network?

Also I don't yet understand how to play nice on a bidirectional pin, but I haven't really looked.


Most of these retro devices operate at 5 V, where as USB operates at 3.3 V (up to 500mA). Arduino's seem to operate at 5 V as well, so that's easy.
_________________
Mike Kasprzak
'eh whatever. I used to make AAA and Indie games | Ludum Dare | Blog | Tweetar
View user's profile Send private message
PoV
Moderator

Joined: 21 Aug 2005
Posts: 10892
Location: Canadia
PostPosted: Fri Jan 09, 2015 6:59 pm    Post subject: Reply with quote

Placeholder post.

Chinese Arduinos are DoFly's, with CH341SER USB to Serial chips.

http://www.rockia.com/2014/01/how-to-make-arduino-dofly-work
_________________
Mike Kasprzak
'eh whatever. I used to make AAA and Indie games | Ludum Dare | Blog | Tweetar
View user's profile Send private message
PoV
Moderator

Joined: 21 Aug 2005
Posts: 10892
Location: Canadia
PostPosted: Fri Jan 09, 2015 7:12 pm    Post subject: Reply with quote

Merry Xmas me! My new toys from China have arrived!

2 of 4 orders from China (AliExpress) have arrived.

THE MOTHERLOAD:



Fake Arduino Uno, Fake Leonardo, Fake Mega, Fake Nano, Fake Micro Pro (unsoldered).



Made in Italy? I have my doubts. :)



Tiny LCD Screen (320x240?), Daughterboard for the Nano, some headers (pin sockets).



Color Change LED's, regular LED's, and microswitches!



The switches are great. Stiff, with a nice click. They also fit the breadboards I bought, which is perfect. :)



Whee!
_________________
Mike Kasprzak
'eh whatever. I used to make AAA and Indie games | Ludum Dare | Blog | Tweetar
View user's profile Send private message
PoV
Moderator

Joined: 21 Aug 2005
Posts: 10892
Location: Canadia
PostPosted: Fri Jan 09, 2015 7:21 pm    Post subject: Reply with quote

Testing the fake Arduinos the best way I can: with the simple audio circuit and ByteBeat Audio!

The Fake Uno and Fake Leonardo:



The Fake Mega and Fake Nano:



Like the dummy post above says, the fake Ardiuno's are apparently based off some Dofly design (Doflye.net). I'm not entirely sure what that is, but I think it might be a Chinese Electronics community.

Anyway's, here's an article that got me up and running:

http://www.rockia.com/2014/01/how-to-make-arduino-dofly-work

Most importantly, I needed the correct driver installed. The USB to serial (COM port) chip used is apparently a CH341 (whatever that means). Driver is here:

http://www.rockia.com/wp-content/uploads/2014/01/CH341SER.zip

After that was installed, all the Fake Arduino's detected just fine, and assign themselves a COM port once connected. I can then use the standard Arduino sketch/test tool to upload programs. I just need to be sure I select the correct base-device (Uno, Leo, Mega, Nano, etc).

Fun fun.

Last thing I need to do is double check that all the items I ordered were in this order. I believe so, but I'm better off checking.


The rest of the parts I'm waiting on are exactly that: parts. A few more LCD screens, but mostly parts. More chips, more headers (sockets), more... I can't remember actually. I better check. :D

EDIT: Yep, everything in the order is here. Coming are 3->8 line decoder chips, sockets for those chips, Shkottky Diodes, and more PIN headers.


The chips I bought are for doing Address decoding. I currently have some shift register chips (for doing 8bit address decoding on a few pins, and 2 or more can be chained together for a 16bit/24bit/32bit decoder). If I ever wanted to read from external RAM or ROM, this would be how I do it, and not waste my pin budget.
_________________
Mike Kasprzak
'eh whatever. I used to make AAA and Indie games | Ludum Dare | Blog | Tweetar
View user's profile Send private message
PoV
Moderator

Joined: 21 Aug 2005
Posts: 10892
Location: Canadia
PostPosted: Fri Jan 09, 2015 8:00 pm    Post subject: Reply with quote

As far as parts go, I should nearly have everything I need now. Certainly the basics are covered (well covered).


Only a few things left on my wishlist.

I'd like to eventually get my hands on some Flash memory. When reading about Raspberry Pi "Hats" (Shields/Addon boards), I stumbled across a simple flash chip with many KB of memory, driven by just a few pins.

https://github.com/raspberrypi/hats

That also means I'm going to need to get my hands on an EEPROM programmer. I'm in no hurry right now, but I think I've bookmarked a decent one on my AliExpress wishlist.

On that same note, if I'm getting an EEPROM programmer, I may as well some other flash chips. Something big enough to hold a C64 or NES ROM (without much bank switching).

Maybe grab some unsoldered Atmega chips (i.e. Naked Ardiuno's) for use with the programmer.

I actually have some simple PIC microcontrollers from way back. There can't be more than 1 KB of memory on them. I think they're 8 pins, but they might be 10 pins (I forget).

Something with an SD-Card slot on it might be nice (Funny, I have an ethernet socket. Not sure how useful it is).


Something with a reprogrammable FPGA would be nice. Perhaps something with a faster CPU and an ARM MBED chip too.

That's all I can think of.



The only annoying thing is I don't have a way to make custom breadboards. I could design them, have them small-run manufactured in China for a reasonable price ($20?), but it's not like I could make them at home.

I used to have photo-chemical kit for making custom circuit boards at home, but TBH I'm kind-of afraid to play with chemicals. ;). I'd rather burn myself with a soldering iron than expose myself to chemicals. :)

Really though, it's all about Cartridge port connectors. Breadboards are good-enough for most prototypes, except those with pins that socket-in to things. I could re-purpose a shitty NES game's PIN connector, and in general work that way, but there's no nice cheap chemical free "make a circuit board at home" thing that I'm aware of.

Not that there needs to be, but I do wish that was a thing. :)
_________________
Mike Kasprzak
'eh whatever. I used to make AAA and Indie games | Ludum Dare | Blog | Tweetar
View user's profile Send private message
PoV
Moderator

Joined: 21 Aug 2005
Posts: 10892
Location: Canadia
PostPosted: Sat Jan 10, 2015 11:24 am    Post subject: Reply with quote

I think it would be cool to hack an LED name badge, and make a game that runs on it. Like a little multi-room platformer/metroidvania where the character is 2 pixels tall.

http://www.amazon.com/Programmable-Scrolling-Badge-12x48-pixels/dp/B00ENN67M0





This one, for example, has a 12x48 pixel display, and obviously a lot of chips of unknown purpose.

- The 74HC595 chips are standard shift register chips. Are they used to address more memory?
- The Chip under the sticker is unknown (additional memory? the silly thing claims 6x 1500 character messages)
- Mystery tiny chip on the left side, a timing/clock chip perhaps?
- The ATMEGA88PA comes up with this: http://www.atmel.com/devices/ATMEGA88PA.aspx

8k Flash, 512 byte EEPROM (save), 1k RAM, and clockable up to 20MHz.

So all things considered, this little guy might make a decent device. I'd probably order from China instead (typically cheaper), but still.

The question is then how to control it.

Ideally, if I was to do this, I'd want a device I could wear as a badge, and hand someone a controller. That makes wireless something desirable.
_________________
Mike Kasprzak
'eh whatever. I used to make AAA and Indie games | Ludum Dare | Blog | Tweetar


Edited by PoV on Sat Jan 10, 2015 12:20 pm; edited 2 times
View user's profile Send private message
PoV
Moderator

Joined: 21 Aug 2005
Posts: 10892
Location: Canadia
PostPosted: Sat Jan 10, 2015 12:16 pm    Post subject: Reply with quote

These chips seem to support a variety of Serial interfaces (I2C, etc), as do a bunch of Bluetooth modules, so adding Bluetooth support may be a simple matter of soldering a few wires from the chip to a module... and of course, driving that module in code.

Ha! Pair it with a NES 30 and you'd have a nice setup.


_________________
Mike Kasprzak
'eh whatever. I used to make AAA and Indie games | Ludum Dare | Blog | Tweetar
View user's profile Send private message
PoV
Moderator

Joined: 21 Aug 2005
Posts: 10892
Location: Canadia
PostPosted: Tue Feb 17, 2015 1:35 pm    Post subject: Reply with quote

Some time ago, I made another China order. This time I grabbed a STUPID amount of IC chips (a few hundred), mostly logic chips (NOT, AND, OR, NOR, NAND, etc). The chips ended up coming from 3 different stores, and in many cases, we're talking $3 for 20-50 chips, which is why it's so many.

I've actually already received 1 of the 3 chip orders, but I'll wait until I get the remaining orders before I take photos. I want to revel in the shear quantity of ICs. :)

I also ordered the 2 missing Ardiunos from my collection:

- a (fake) UNO with the DIP socket chip (my other fake-UNO has the chip soldered to the board)
- a (fake) DUO (i.e. with a 32bit ARM SOC, versus the 8bit Atmel SOC's on most Arduinos)

Those arrived in separate orders yesterday and today, so I gave them the usual test.



Also, I now have an EEPROM programmer.



Again, I'll photograph the other parts when the remainder of the chips arrive (and with a better camera, yikes).
_________________
Mike Kasprzak
'eh whatever. I used to make AAA and Indie games | Ludum Dare | Blog | Tweetar
View user's profile Send private message
Sirocco
Moderator

Joined: 19 Aug 2005
Posts: 9453
Location: Not Finland
PostPosted: Tue Feb 17, 2015 3:12 pm    Post subject: Reply with quote

I'm in the midst of designing an Arduino project right now. It'll just be a controller, a thermocouple or two, a servo (or two), and I'd like to have an LCD display for status/fault annunciation.

The programming looks dirt-simple; that makes me happy.


Quote:

Also, I now have an EEPROM programmer.


SEXY.
_________________
NoOP / Reyn Time -- The $ is screwing everyone these days. (0xDB)
View user's profile Send private message Visit poster's website
PoV
Moderator

Joined: 21 Aug 2005
Posts: 10892
Location: Canadia
PostPosted: Mon Feb 23, 2015 8:31 am    Post subject: Reply with quote

Okay, the rest of my China order arrived. Here's my ridiculous IC chip collection (and a few other parts... whoops, the bag of switches are out-of-frame).





As you can see, I went ahead and labelled everything, and included a logic symbol just 'cause. I'm certainly not going to remember that a 74HC02 is a NOR gate. I'll still have to check data-sheets online for pinouts, but being able to quickly find what I want is nice. That, and the printing on the chips is sometimes really hard to read. You need to be in the perfect light.

To be honest, I'll probably never do a serious project that needs boolean logic chips. I just... kinda wanted them... because... well, I'm a nerd.

Really, all I probably needed were the NOT, NAND and NOR chips, the decoders and shift registers. The rest, totally just nerding out.

Also, a better look at the new Fake Arduinos.



The taller switches and speakers.



Be sure to remove the seal AFTER washing yo!


All this because I bought the wrong chip style (SIP not DIP) in my first order. ;)

* * *

Anyway, I believe I am done ordering parts from China (for now). I need to do some homework on memories and flip-flops next, so I know what to order.

I should also tear apart a NES cart, to guage what I have. The only real project I have is I want to make my own NES flash cart. I want to figure out what flash chips I can use, and what I need to program a flash chip using a USB port. If there's a tiny USB module I can wire up to a socket to porgram the chip, that's ideal, but worst case I'm sure a tiny Arduino will do the job.

That's my winter project... not this winter, next winter. ;)
_________________
Mike Kasprzak
'eh whatever. I used to make AAA and Indie games | Ludum Dare | Blog | Tweetar
View user's profile Send private message
Sirocco
Moderator

Joined: 19 Aug 2005
Posts: 9453
Location: Not Finland
PostPosted: Mon Feb 23, 2015 4:45 pm    Post subject: Reply with quote

Fauxduino?
_________________
NoOP / Reyn Time -- The $ is screwing everyone these days. (0xDB)
View user's profile Send private message Visit poster's website
PoV
Moderator

Joined: 21 Aug 2005
Posts: 10892
Location: Canadia
PostPosted: Mon Feb 23, 2015 5:57 pm    Post subject: Reply with quote

Yes. They're based on the original designs, 'cause of the whole "open source hardware" thing. Totally legal, but I like to think of them as fake because they're so cheap. ;)

http://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20150223173435&SearchText=arduino

If you know which ones you want, you get them stupidly cheap. Best bargains are UNO's and NANO's.

http://www.aliexpress.com/store/group/For-Arduino/1185416_254803293.html

~$3 each, free shipping. Takes about 2-3 weeks to arrive.

Some of the assembly quality is questionable, but the parts are all good. Worst case, you might have to bend or re-solder headers/pins, but most of the fakes I ordered were fine.

You probably need a different driver, but they work exactly the same inside the Arduino software. http://www.rockia.com/2014/01/how-to-make-arduino-dofly-work
_________________
Mike Kasprzak
'eh whatever. I used to make AAA and Indie games | Ludum Dare | Blog | Tweetar
View user's profile Send private message
Sirocco
Moderator

Joined: 19 Aug 2005
Posts: 9453
Location: Not Finland
PostPosted: Thu Feb 26, 2015 8:42 pm    Post subject: Reply with quote

I need to try out one of the cheap-o units "just cuz." The programming for the Arduino's looks super comfy.
_________________
NoOP / Reyn Time -- The $ is screwing everyone these days. (0xDB)
View user's profile Send private message Visit poster's website
PoV
Moderator

Joined: 21 Aug 2005
Posts: 10892
Location: Canadia
PostPosted: Tue Sep 29, 2015 7:49 am    Post subject: Reply with quote

Not Arduino, but also a mini-computer.

* * *

Check out this block of code no larger than a tweet.

Code:
void p_itof(int *a, float *c, int n, int p, p_team_t team) {
        int i;
        for(i = 0; i < n; i++) {
                *(c + i) = (float)(*(a + i));
        }
}

I wrote that some months ago, and got a free 18 core mini computer as a reward.

https://www.parallella.org/





Seems fair. :D
_________________
Mike Kasprzak
'eh whatever. I used to make AAA and Indie games | Ludum Dare | Blog | Tweetar
View user's profile Send private message
PoV
Moderator

Joined: 21 Aug 2005
Posts: 10892
Location: Canadia
PostPosted: Mon Nov 02, 2015 7:57 pm    Post subject: Reply with quote

Custom boards.

https://oshpark.com/pricing

Free Shipping. Two week turn around, made+shipped from USA. Copper, purple, and a layer of white ink.

3x - $5 per square inch, two layers (top+bottom).
3x - $10 per square inch, four layers (top+bottom+middle one+middle two).
?? - $150 for 150 square inches worth of boards, in any combination, two layers. Can include multiple designs, minimum 10 of each design.
?? - $300 for 150 square inches worth of boards, in any combination, four layers. ^

* * *

http://www.seeedstudio.com/service/

Paid Shipping. One week turn around, made+shipped from China. Copper, green, layer of white ink.

10x - $10 for 2x2 inches, two layers.
Prices go up as you increase dimensions and layers, but additional boards merely cost dollars more.

They also offer PCB populating services.
_________________
Mike Kasprzak
'eh whatever. I used to make AAA and Indie games | Ludum Dare | Blog | Tweetar
View user's profile Send private message
Reply to topic GDR Forum Index -> Game Developer's Refuge -> Arduino and Microcontroller Fun Times Page 1, 2  Next

Use this link to get a Sign-On Bonus when you get started!

All trademarks and copyrights on this page are owned by their respective owners. All comments owned by their respective posters.
phpBB code © 2001, 2005 phpBB Group. Other message board code © Kevin Reems.