mirror of
https://github.com/guezoloic/6502_project.git
synced 2026-01-25 09:34:06 +00:00
feat: add input pins
This commit is contained in:
@@ -1,9 +1,17 @@
|
|||||||
#define CLOCK_PIN 13
|
#define CLOCK_PIN 13
|
||||||
|
#define INPUT_PINS 8
|
||||||
#define OUTPUT_PINS 1
|
#define OUTPUT_PINS 1
|
||||||
#define CLOCK_MS 150
|
#define CLOCK_MS 150
|
||||||
|
|
||||||
|
int inputs[INPUT_PINS] = {2, 3, 4, 5, 6, 7, 8, 9};
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
Serial.begin(9600);
|
Serial.begin(9600);
|
||||||
|
|
||||||
|
// INPUT
|
||||||
|
for (int i = 0; i<INPUT_PINS; i++) {
|
||||||
|
pinMode(inputs[i], INPUT);
|
||||||
|
}
|
||||||
|
|
||||||
// OUTPUT
|
// OUTPUT
|
||||||
pinMode(CLOCK_PIN, OUTPUT);
|
pinMode(CLOCK_PIN, OUTPUT);
|
||||||
@@ -14,6 +22,11 @@ void loop() {
|
|||||||
digitalWrite(CLOCK_PIN, HIGH);
|
digitalWrite(CLOCK_PIN, HIGH);
|
||||||
delay(CLOCK_MS);
|
delay(CLOCK_MS);
|
||||||
|
|
||||||
|
// INPUT ACTION
|
||||||
|
for(int i = INPUT_PINS - 1; i >= 0; i--) {
|
||||||
|
Serial.print(digitalRead)
|
||||||
|
}
|
||||||
|
|
||||||
// CLOCK LOW
|
// CLOCK LOW
|
||||||
digitalWrite(CLOCK_PIN, LOW);
|
digitalWrite(CLOCK_PIN, LOW);
|
||||||
delay(CLOCK_MS);
|
delay(CLOCK_MS);
|
||||||
|
|||||||
Reference in New Issue
Block a user