Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ISR(INT4_vect){
- //if(first_start == 0){
- //first_start = 1;
- //}else{
- hopper_pulse++;
- btn_enabled = 0;
- if(hopper_pulse == coin_for_out){
- EIMSK &= ~(1<<INT4);
- //TCNT3 = 0;
- //START_HOPPER_TIMER;
- PORTJ &=~ (1<<PJ2);
- hopper_complete = 0;
- coin_for_out=0;
- hopper_pulse = 0;
- PORTJ &= ~(1<<PJ4);
- //START_BTN_TIMER;
- }
- //}
- }
- if (!(PINA & (1<<PA3)) ){
- //btn_pressed_flag = 1;
- if(bill_summ>49 & btn_enabled == 1){//
- PORTJ |= (1<<PJ5);
- btn_enabled = 0;
- //coin_for_out = 1;
- coin_for_out = bill_summ / COIN_PRICE;
- summ_reciept = coin_for_out*COIN_PRICE;
- bill_summ = bill_summ - (coin_for_out*COIN_PRICE);//
- first_start = 0;
- send_sale(summ_reciept);
- hopper_pulse = 0;
- EIMSK |= (1<<INT4);
- out_coin();
- printSumm(bill_summ);
- PORTJ &= ~(1<<PJ5);
- }
- }
- void out_coin(){
- PORTJ |= (1<<PJ2);
- PORTJ |= (1<<PJ4);//LED ON
- //START_HOPPER_TIMER;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement