BotronikS - Final code for all types of Arduino and PC users: -- HOME -- email: botronik@gmail.com

CO3: The counter with 4 preset values (P1 -P4) counts up to the sum of all, activating the corresponding outputs (Out1-Out4 ) and with the auto-reset function...

connections (click to enlarge)

Use accessories:  
DisplayTube TM1637 4digit
RelayShield1-4Rel
PushButtons
 
 
 
Trial codes here! Make donations and send your email request for the final (no limit) HEX codes!
 
Download the HEX codes below, unpack and upload to the proper Arduino board (Use a free net tool for example XLoader)
1. ATmega328-16MHz (MINI,NANO,UNO...): 4digit: CO3Code1try-m328 - Trial code - limited P1-P4 to 25!
2. AtMega2560 (Mega(ATMEGA2560)........): 4digit: CO3Code1try-m2560 - Trial code - limited P1-P4 to 25!
 

User guide manual:
P1-P4: Set required number SV2: Set time duration of Auto-Reset function (x0,1sec.)
After applying the power (or a reset), the display shows (----) for about 3 sec. During that time:
Do action1: DEFAULT settings: Press both buttons (PB1+PB2) and when the screen turns off release. Be sure to do it (only once) after uploading the hex code in Arduino!
Do action2: PRESET settings: Press the PB1 button and when the screen turns off release:
P10: Display brightness intensity (0-7)
P12: no function
 
SETtings (during normal operating - all changes stay memorized):
SET P1-P4: Press the PB1(+) button (until the display goes off then release). The value that can be changed on the buttons (PB1/PB2=+/-) is displayed. After 2 seconds of inactivity, the value on the display is stored.
SET SV2: Press the PB2(-) button (until the display goes off then release). The value that can be changed on the buttons (+/-) is displayed. After 2 seconds of inactivity, the value is stored.
The screen shows the sum of individual values. The start of the work cycle is on the START push button (on screen 0). A working cycle can interrupt on RESET button.
 
Status of outputs:
Out1: Active from 0 to P1
Out2: Active from P1 to (P1+P2)
Out3: Active from (P1+P2) to (P1+P2+P3)
Out4: Active from (P1+P2+P3) to (P1+P2+P3+P4)
Out5: Active while auto-reset time is active.