Search results

  1. Crystal Wizard

    Which Microcontrollers to get?

    You can get smaller Arduinos. I picked up a Nano Clone for £3.50 :) http://www.ebay.co.uk/itm/Arduino-Nano-v3-with-soldered-headers-ATmega328P-/151963673207?hash=item2361bda277:g:xL4AAOSwqrtWp5Al
  2. Crystal Wizard

    Assorted Gubbins on toy tank

    If it will whet your appetite, here is a pic of my previous (non-electronic) version, and my Work-In-Progress. The colours will be reversed, with the LEDs on the (currently unattached) top-plate.
  3. Crystal Wizard

    How do I multiplex lots of switches/LEDs with my Arduino

    Me again! :) I've got a bag full of 595s and 166s. I've built a circuit using an OUTPUT shift-register (595). All works fine. But I need to expand, and use an INPUT shift-register for my rack of switches/buttons. (also a 2nd OUTPUT shift-register, but that looks OK ...) Every tutorial/example...
  4. Crystal Wizard

    Assorted Gubbins on toy tank

    Circuit fixed! :) I now have 4 Hull Point LEDs that go up and down with the two +/- switches, a speed-selector (stop, slow, fast), and if Immobile is set, speed sets to Stop, no matter the Selector! I'm using some of the Analogue pins as Digital Inputs, but may replace this with Input Shift...
  5. Crystal Wizard

    Assorted Gubbins on toy tank

    Can't get the boolean bitmasking to work. Have gone for shifting instead, using boolean variables: Variables: 4 Hull Point LEDs, 3 Speed LEDs, Immobile LED = 8 byte data = 00000000; data+=immobileled; data <<=1; data+=hp4led; data<<=1; data+=hp3led; data<<=1; data+=hp2led...
  6. Crystal Wizard

    Assorted Gubbins on toy tank

    OK, I have a shift register for my output LEDs. I have some code that looks at the switches/buttons and calculates values for LEDs. I have looked at this code: https://www.arduino.cc/en/Tutorial/ShftOut13 which uses a HEX number (equivalent to the binary on/off LEDs) in its ShiftOut function to...
  7. Crystal Wizard

    Assorted Gubbins on toy tank

    Gotya! :) My shift-registers and switches have arrived, so I'm off to write some code, and build some breadboards! Watch this space! :)
  8. Crystal Wizard

    Assorted Gubbins on toy tank

    So, the code would be: #define variables #define function myDebounce() //reads all buttons, checks if any have changed (initial IF statement). // If any have changed, increment counter. // if counter <20, do nothing. // If counter =>20, set variables = pin-states //should the i=0 (reset...
  9. Crystal Wizard

    Assorted Gubbins on toy tank

    Thanks for the quick reply! I think I'd prefer to use Method 2, non-blocking. It does look more elegant, if trickier. I'm not sure if using a shift-register counts as "directly driving multiplexed LEDs" or not. I've just sent off for some 74HC595 and 74HC166 chips to run the switches/buttons...
  10. Crystal Wizard

    Assorted Gubbins on toy tank

    No, I'm still struggling with debounce. I've read lots, but I'm not taking it in. :( Hopefully my switches arrive tomorrow, and I'll build a new circuit. Then I can rewrite my code (incl debounce) One thing that I have NOT seen addressed is Multiple Buttons. I'm not sure which variables need...
  11. Crystal Wizard

    How do I multiplex lots of switches/LEDs with my Arduino

    I have been using bitsbox.co.uk. I am only ordering small amounts ( <£20) at a time. I know I can chain shift-registers together, but would be interested in a 16-bit IC, to keep both code and hardware tidy (I am limited on space).
  12. Crystal Wizard

    Assorted Gubbins on toy tank

    1) Now I've started building, should this be in Project Logs, or should I continue here? 2) If I'm using shift-registers for inputs, do I still need to debounce? 3) I've been looking at shift-register output tutorials, but can't quite figure it out. They all seem to deal with "regular"...
  13. Crystal Wizard

    How do I multiplex lots of switches/LEDs with my Arduino

    I'm struggling to source a 74HC165 from my favoured suppliers. Would a 74HCT164 do the same job? Or is there a good place to buy a 165?
  14. Crystal Wizard

    Assorted Gubbins on toy tank

    UPDATE: No debounce. No time-delay. Hull Point LEDs work. (only using 2, for proof of concept/lack of pins) Start = 2 LEDs on. Press "down", hp-- Press "up" hp++ HP=2, both LEDs on. HP = 1, one LED on HP = 0, LEDs flash alternately, then go off (repeat) I think Bounce is causing "one press" to...
  15. Crystal Wizard

    Assorted Gubbins on toy tank

    OK, Debounce. Ugh. And checking Release as well? This means I need to check button is not going on and off (bounce), but also check button IS going on and off (press and release to only adjust HP once per press). OR use a Latching button (toggle?), and adjust HP each time it changes state...
  16. Crystal Wizard

    Assorted Gubbins on toy tank

    Progress Report: Speed-selector is working! Set a switch selecting Stop (Red), Slow (Yellow) or Fast (Red), and the appropriate LED lights up. UNLESS the Immobile switch is set, when the 'Immobile' LED lights up (inbuilt pin13 LED), and the Stop LED lights up, no matter what speed is selected...
  17. Crystal Wizard

    Assorted Gubbins on toy tank

    More Progress! LED #13 flashes. If button is pressed while LED off, it swaps whether LED #11 or #12 is on! Right, I'm gaining confidence with breadboard and sketches. I've written the main test-sketch for 7 LEDs, 7 switch/button inputs. Now I need to buy some buttons and switches, and wire...
  18. Crystal Wizard

    Assorted Gubbins on toy tank

    I appreciate the optimism! :) I think momentary buttons will be better for how I want most sections to work. I'm very much focusing on the end-use experience, and how to make it happen.
  19. Crystal Wizard

    Assorted Gubbins on toy tank

    Test will probably use more switches. Final build I'm not sure. Probably buttons.
  20. Crystal Wizard

    Assorted Gubbins on toy tank

    Progress Report: My Arduino (Nano-Clone) has arrived! :) :) :) I have successfully plugged it into my PC, installed Drivers, programmed a Sketch onto the Arduino. Altered the Sketch and re-programmed. Moved Arduino onto breadboard, powered it with the 9v -> 5v Linear regulator I built myself...
Top