Author Topic: Button Minder - My First Digispark Project  (Read 6843 times)

zapta

  • Newbie
  • *
  • Posts: 13
Button Minder - My First Digispark Project
« on: October 31, 2013, 10:55:09 pm »
Well, here is my first Digispark and Arduino project.  I was always curious about the Arduino thing so when I needed a small logic functionality I decided to give it a try, and I must say, it was a lot of fun. I was expected some childish programming language and found a highly functional subset of C++. The Arduino IDE was a little bit on the basic side but this also added to the charm.

I developed the project using github and all the files can be found here:

https://github.com/zapta/button-minder



The circuit I use to test the firmware while developing.


The final connection diagram.

If you wonder what it does, my car has a Sport Mode button that makes the car more responsive. Problem is, I cannot set it to start in Sport Mode and need to press it manually each time I start the car. Here comes Button Minder to the rescue, it is embedded inside the console and whenever I turn the ignition on it presses the button for me.  It also allows to enable/disable its functionality by holding down the Sport Mode button when turning the ignition on (the new state is stored in the EEPROM).

The program does not use delay() and keeps spinning the loop iteration. This way it can response to inputs (e.g. debunking) and keep blinking the diagnostic LED.

I did ordered the programming board but found it to be bulky so instead I removed D3 from the DS and connected instead a small normally-close micro switch. This way I can 'remove and reinsert' the board for programming by pressing the micro switch for few seconds.

I must say, Digispark is a lot of fun.


defragster

  • Sr. Member
  • ****
  • Posts: 467
Re: Button Minder - My First Digispark Project
« Reply #1 on: December 15, 2013, 02:22:33 am »
Interesting adjustment and solution to the car.  Would like to see a photo of your 'adjusted' spark for programming.  Losing the D3 will remove a volage drop and some polarity protection or USB voltage feedback?

Mark

  • Full Member
  • ***
  • Posts: 196
Re: Button Minder - My First Digispark Project
« Reply #2 on: December 20, 2013, 07:27:06 pm »
Zapta
Welcome to the world of Arduino.

One of the things to look at is 'Blinkwithoutdelay' example.

Instead of delay, you can use the Millis() timer to achieve the required 'delays'.
In your situation you won't get the rollover (49 days + some hours and minutes), but the idea is to always subtract the stored value from the current Millis() reading.


Cheers
Mark