<commit_before>package com.ociweb;


import static com.ociweb.iot.grove.GroveTwig.*;
import com.ociweb.iot.maker.*;
import static com.ociweb.iot.maker.Port.*;

import com.ociweb.iot.grove.Grove_FourDigitDisplay;
import com.ociweb.iot.grove.display.FourDigitDisplay;
import com.ociweb.gl.api.GreenCommandChannel;

public class IoTApp implements FogApp
{
	private static final Port CLOCK = D5;
	private static final Port DATA = D6;

	@Override
	public void declareConnections(Hardware c) {
		c.connect(FourDigitDisplay, CLOCK);
		c.connect(FourDigitDisplay, DATA);
		c.connect(Button, D2,50,false);

	}

	@Override
	public void declareBehavior(FogRuntime runtime) {

		final FogCommandChannel ch = runtime.newCommandChannel(GreenCommandChannel.DYNAMIC_MESSAGING);
		final FourDigitDisplay dis = new FourDigitDisplay(ch);
		runtime.addDigitalListener((port, a,b, val)->{	
			System.out.println("printing to 4-digit display!");
			Grove_FourDigitDisplay.printDigitAt(ch, 1, 0, true);
			Grove_FourDigitDisplay.printDigitAt(ch, 2, 1, true);
			Grove_FourDigitDisplay.printDigitAt(ch, 3, 2, true);
			Grove_FourDigitDisplay.printDigitAt(ch, 4, 3, true);
			
		}).includePorts(D2);
		
	}
}<commit_msg>reverted back to 4 digit code, was using it to test oled in the mean time<commit_after>package com.ociweb;


import static com.ociweb.iot.grove.GroveTwig.*;
import com.ociweb.iot.maker.*;
import static com.ociweb.iot.maker.Port.*;

import com.ociweb.iot.grove.Grove_FourDigitDisplay;
import static com.ociweb.iot.grove.Grove_FourDigitDisplay.*;
import com.ociweb.gl.api.GreenCommandChannel;

public class IoTApp implements FogApp
{
	//private static final Port CLOCK = D5;
	//private static final Port DATA = D6;

	@Override
	public void declareConnections(Hardware c) {
		c.connect(FourDigitDisplay, CLOCK);
		c.connect(FourDigitDisplay, DATA);
		c.connect(Button, D2,50,false);
	

	}

	@Override
	public void declareBehavior(FogRuntime runtime) {

		final FogCommandChannel ch = runtime.newCommandChannel(GreenCommandChannel.DYNAMIC_MESSAGING,300);
		runtime.addDigitalListener((port, a,b, val)->{	
			if (val !=0){
				System.out.println("Pressed");
				//Grove_FourDigitDisplay.printDigitAt(ch, 0, 0, true);
				Grove_FourDigitDisplay.printDigitAt(ch, 2, 0);
			}
		}).includePorts(D2);

	}
}
{'fraction_non_alphanumeric': 0.11703056768558952, 'fraction_numerical': 0.013100436681222707, 'mean_word_length': 5.076923076923077, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7553539', 'n_tokens_mistral': 897, 'n_tokens_neox': 792, 'n_words': 166}