From 143421d75ebb0b94ce2618cccc15b1447b57c2f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20MOR?= Date: Tue, 14 Nov 2023 13:35:58 +0100 Subject: [PATCH] Fix the length and width of the table : the LEDs are layed out the other way --- README.md | 4 +++- arcadeTable_arduino/arcadeTable_arduino.ino | 11 +++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index c96a10e..eeb1a7d 100644 --- a/README.md +++ b/README.md @@ -4,4 +4,6 @@ Code for [makers-game](https://github.com/emlyon/makers-game) ___ Install openFrameworks on Raspberry Pi using this guide: http://openframeworks.cc/setup/raspberrypi/raspberry-pi-getting-started/ -Clone this rep in `~/openFrameworks/apps/myApps/`, then `make` +Install git with `sudo apt-get install git`. + +Clone this rep in `~/openFrameworks/apps/myApps/`, then `cd` into the newly created folder and `make && make run` diff --git a/arcadeTable_arduino/arcadeTable_arduino.ino b/arcadeTable_arduino/arcadeTable_arduino.ino index a623d7b..3ed16db 100644 --- a/arcadeTable_arduino/arcadeTable_arduino.ino +++ b/arcadeTable_arduino/arcadeTable_arduino.ino @@ -3,6 +3,9 @@ #define PIN 6 #define NUMPIXELS 209 +#define WIDTH 19 +#define HEIGHT 11 + #define BLACK strip.Color( 0, 0, 0 ) #define WHITE strip.Color( 255, 255, 255 ) #define RED strip.Color( 255, 0, 0 ) @@ -30,10 +33,10 @@ void loop() { strip.setPixelColor( i, BLACK ); } - int col = ( millis() / 100 ) % 11; - int startIndex = col * 19; - for( int i = 0; i < 19; i ++ ) { - strip.setPixelColor( i + startIndex, GREEN ); + int line = ( millis() / 200 ) % WIDTH; + int startIndex = line * HEIGHT; + for( int i = 0; i < HEIGHT; i ++ ) { + strip.setPixelColor( i + startIndex, ORANGE ); } strip.show(); }