Meaning if I wanted to manually create a 32K hex file I could take the original sketch hex and the relevant hex file for the bootloader being used and put them together in a 32k hex file.
I assume I wouldn't have to care about what's between the Sketch hex and the Bootloader hex? Also, even if the bootloader is smaller than 4096 (and space permitting) could I start all versions of a bootloader at 7000?
Is there any easy way to upload the Arduino Bootloader and a Sketch to the Atmega 328 using an Arduino as the programming platform? I'm looking to put together a project for our hackspace and so may need to add the bootloader and sketches to a lot of ICs.
The suggestions froin Zaplady and davidtraynor work for me with my cheap ebayed stepper motors. Like Zaplady mine came with a ULN2003 driver board with LEDs. These things can now get purchased for less than £2.00. So, assuming complete accuracy and the funky cross over wiring isn't a problem then they look like a good tinkerer option.
As a side note. When I wired mine up first time and used the same sketch it went clockwise and anti-clockwise with no modifications. I then disconnected the driver and motor to test my second one and it would only go clockwise. Re-attached the original and it would only go clockwise as well. So, strange behaviour but then for £2.00 each I expect some slight fun in getting them working.
I was doing something similar but controlling from a PC based webserver. The Arduino is running a web server sketch as well and reading the HTTP Request details for the actions. With this you can control 5 relays
I got a bit of time to play with this again. Now the webserver code calls the details from a mySQL database for each Arduino and then for each pin being used in each Arduino. This effectively allows you to control as many pins as you want on any number of Arduinos , only limited by your IP addresses and patience to enter them all in.
Updated blog post with the details of the database and the revised PHP code. WARNING: The PHP code is very much first pass. There are lots of areas it could be improved. But while I'm working on it, it makes sense to me.
Next step is to code a few pages to allow the adding/removing of Arduino and Pins without having to resort to mySqlAdmin. Once done I need to figure out how to get the status of the pins from the webserver running on the Arduino. The examples I have seen for the ENC28J60 have been presenting a PROGMEM page, so cannot be modified once the code has started.
I've been playing with the ENC28J60 for a few months and even thought it isn't as easy to work with as the official EtherShield it is still a great (really cheap) bit of kit) One of my goals was to control the Arduino Pins from a web page. Kind of home automation type scenario. This is the first step in that direction.
I have a XAMP web server installed on my netbook with delivers a PHP web page to the browser. The web page gives me the options to turn on or off 2 LEDs on pins 2 and 4 of the Arduino. When I press a button the web page is called again and in the background the web server does an fopen() call to the Arduino with the requested action. By using fopen() the actual command sent to the Arduino is not seen by the user.
The below video shows it working and in the description on Youtube there is a link to my blog with further details and the code for the web server and the Arduino.
It thing it must be possible to get lower sram use. Maybe you should check The games on hackvision or Wayne and layne's Video game shield. But probable you already did.
I expect your right in reducing the SRAM . My understanding is that the Hackvision and Wayne and Iayne's shield both use the TVOut Library by Myles Metzler and their games are far more complex then anything I am producing You can store graphics in the 32K of FLASH memory on the Arduino so extra graphics to some extend reduces the memory usage.
My understanding is that a resolution of 120x96 uses 1,440 bytes (120x96/8), leaving 608 bytes for all other variables. There are 2 byte arrays for the playing area 13x6 (78 bytes). One for the display and the other for when I'm checking for 3s. Another 156 Bytes, leaving 452. Any text on screen takes up SRAM as well. There are about 50 Bytes used for the opening text and 27 for the GAME OVER screen, so another 72 BYTES Leaving 380 bytes.
Then there is the SRAM used by the TVOut Library just to function. I have no idea how it uses.
So, it got pretty tight in there.
Looking at that HackVision the closest program I would expect is Tetris. In that case all blocks once placed are the same so there is no need to record the different types of blocks at each position. It would be possible to use the get_pixel(x,y) command to check if a block has been placed at a location.
That said I know my code is not optimised. I learned to code on a VIC-20/C64 back in the 80's and it's still the same coding practices I use now. One of these days I'll figure out how to program in C++ properly. I looked at some of the HackVison code and it is way beyond what I have done.
That's the great thing about the Arduino. Even basic programmers like me can put together something that works. Then there is the opportunity to learn and refine and get even better without it being overwhelming at any time.
I posted this in the [Using Arduino :: Displays ::] forum and somebody suggested I put it in the Exhibition Forum, so I'm posting here also. If I've done this the wrong way I'm sorry.
I saw the TVOut ( http://code.google.com/p/arduino-tvout/ ) library about a year ago and finally got to do some hacking with it. I decided that I would recreate the classic game Columns which has the fell of Tetris, but isn't In columns it is always 3 blocks that fall vertically. You can move the blocks left and right and rotate the 3 blocks, so the top one goes to the middle, the middle to the bottom and the bottom to the top. The goal is get 3 in a row, either vertically, horizontally or diagonally. Then those 3 pieces are removed and the blocks above fall down.
The code is still a bit of a mess, so needs a little bit of cleaning up before I make it public (which I will). If you want a copy of the rough, nasty typo comment filled code let me know and I'd be happy to send it on.
The controls are just 3 tactile button on a breadboard, so this should work on any 328 based Arduino (needs 2K of SRAM as the display alone takes 1,440 bytes)
I have done a short video of it working on YouTube.
All I can say is Thank You to mdmetzle for creating a fantastic Library that made this possible.
Thanks for the recommendations. I sue to own a copy of Kernighan and Ritchie C book about 25 years ago but it's been lost in the many moves. I'll start with http://www.cplusplus.com/ and see how I get on. I'm trying to use libraries by reading the sample code and sometime the syntax and coding is beating me.
I've been playing with Arduino for about a year and I'm happy that for the most part I can figure out the electronics and wiring. Where I'm struggling is with the 'advanced' coding. Things like pointers, changing variable types, creating my own libraries,...
So, I would appreciate recommendations for books or online resources that will help me.