Giter Club home page Giter Club logo

arduinostuff's People

Contributors

kieran-boyle avatar riolaurenti avatar squatnet avatar

Stargazers

 avatar

Watchers

 avatar

arduinostuff's Issues

Polling i2c doesnt always work

Trying to get data from the uno often results in loss of data...
we expect {STR,1,0,0,0,0,255,255,4,1,10} {name,pin0,pin1,pin2,pin3,red,green,blue,pattern,automode,timer}
often we just get {

individual strip mode breaks the world

when turning auto strip mode on, causes crashes, as yet unsure if just strips themselves or if this also crashes the routers (looks like t may be a different problem see #71)

Path to closing project board

  • Acrylic, Frosting vinyl and back panels for 2560 matrix'.
  • Safe mounting of storage of Battery and Inverter
  • Select colour of text, final touches to goDot app.
  • Extension cables (3p JST and DC barrel jack)
  • Spare LED Strip lights
  • Update and Upload Demo Code onto MCU's.

I2CtoFastLEDs reset

Allow devices Running I2CtoFastLEDs code to be reset by their routers.


* @todo I2CtoFastLEDs reset
* @body Allow devices Running I2CtoFastLEDs code to be reset by their routers.
*/
// Varidaic Debug Macro
#define DEBUG //Comment this line to disable Debug output
#ifdef DEBUG // Debug is on


This issue was generated by todo based on a @todo comment in 2f9f995 when #53 was merged. cc @Squatnet.

LED ART - Branch

Separate Area for all Artistic and Conceptual code related to LOres LED displays.
Hopefully we can get Noz involved with the sparkly sh*t and @kieran-boyle.
Everything is focusing on Strips for now, although I will be building some development matrices later, but thats a whole new issue.
Aims:

  • Defining Colour Palettes.
  • Controlling Shapes (Strips in Squares, Pentagon, Hex, Oct and Circle formations)
  • Pixel referencing (eg, 1 LED travelling from strip#1 led#1 >> strip#4 led#30)
  • Comprehensive understanding of FastLED fastMATH functions .. give the end users real control of the rainbow etc etc

Finishing touches for Demo's

  • *** CHECKLIST ! To check items as packed for demo's
  • Longer DC matrix power cables.
  • 1st DEV re-introduced for demo only, then recycled.
  • *** Storage in seperate boxes
  • ***Change one Matrix Wire.begin(#).
  • *** update number of LED per strip to 58.!
  • *** Build Matrix Hooks and Chain hangings.
    - [ ] *** Fix the scroll text (Added text onto existing text field and did not update) issue moved to #20
  • Big FUCKING RIGGING LIGHTS ** Future purchase planned
  • USB battery packs
  • Secure hc-05 and any other relevant circuitry (LEDS).

Function on Clock

#34
Opened separate issue for 'Sequencing'
WIZ------MASTER ---- --- A/B/C/D...

Aim: To control division of incoming OSC clock signals from the Master via Routers to LED's.

Current Objective: Send change function message every 4/8/16/32 beats.
Secondary Objective: Send change function in ratio to CLK#1, eg every 3/4 beats to router A/B.

First steps are to debug IIC on master, check for unwarranted activity when interacting with HC05 and PJON.

WhiteLED crash...

Turning the LEDS to all on with white color crashes the whole thing.

Additions to I2CtoFastLeds code

I2CtoFastLEDS code requires some additions to facilitate sending the number of connected strips back to I2C master... The PJON Master code has been updated already.
We will use Wire.requestEvent() to request 1 byte from slave num 1

I2CtoFastLEDs.ino

in setup() add
Wire.onRequest(requestEvent);

just before void receiveEvent(int howMany) function add

// Function to reply to master when master requests data 
// In this case master will want to know how many strips are connected
void requestEvent() {
  Wire.write(NUM_STRIPS); // respond with NUM_STRIPS
}

this will allow I2CtoFastLEDS to respond to a request with NUM_STRIPS

pjonToI2C.ino

in setup() remove the line DPRINTLN("Done!!!"); from below Wire.begin()
and then add

  DPRINT(". ");
  Wire.requestFrom(1, 1); // request 1 byte from Wire(1)
  DPRINT(". ");
  delay(100); // To make sure request is handled
  DPRINTLN("Done!!!");
  DPRINT("Slave has ");
  String attchSt = ",";
  while (Wire.available()) { // slave may send less than requested
    char c = Wire.read(); // receive a byte as character
    attchSt.concat(c);         // print the character
  }
  DPRINT(attchSt);
  DPRINTLN(" strips attached.");
  regString.concat(attchSt);

this will allow pjonToI2C to request NUM_STRIPS from slave 1 and append the value to regString before reporting to PJON master (we assume all slaves have the same number of strips attached. differing numbers of strips per i2c slave is just overcomplicating the overcomplicated)

Nano Slave RS485 Receiver aNCS_LED_041

2 nanos, RS485 > i2c > fastleds

RS485

Needs to

  • Accept rs485 connection and send to appropriate i2c device,

could do

  • Report back to #6 021/0c with status of connected devices
  • support multiple devices with addition i2c buses

FastLeds

Needs to

  • Accept i2c messages and display leds appropriately

Could do

  • allow inversion of rows, creating artistic patterns with a single long strip.
  • report back via i2c

ALL command

Propose adding a new button to ANCS app to allow sending ALLX command, Controlling every Matrix and Strip at once.

Code for Host MCU aNCS_LED_021/0c

bluetooth > i2c master hub

Needs to

  • receive bluetooth from godot application
  • send i2c message to multiple slaves VIA rs485 on #5 aNCS_LED_020/0b
  • send i2c directly to matrix boards

Could do

  • receive information about network status and connected devices and relay this to bluetooth app
  • receive OSC from ANCS and relay to bluetooth app
  • turn bluetooth messages into OSC and send to ANCS
  • TFT serial out
  • Ethernet?

PJON Dev2 Working

Created this issue to track Dev 2 as a whole, Thinking we can reference it in commit messages every time we do something DV2 related.
i Dunno

Draw shape functions draw directly to matrix.

The draw functions from FastLED_GFX.h (e.g. DrawRectangle, DrawLine, ect.) directly affect the matrix via X,Y bypassing the setLEDs function.
this causes an issue as we are unable to address the matrix directly with our other patterns (hence the use of a CRGB array, CRGB leds[NUM_LEDS]; )
as such setLEDs is called in loop, and would override the pattern called by any use of draw functions.
Proposed initial solution.
for now i will wrap the setLED function call, from loop, in an if statement, checking that the pattern number is bellow where i add patterns that use the alternate addressing method.
this will ensure that interference doesn't occur, however is not an ideal solution as it is another variable to track when adding patterns.
Will look into a better solution. this is here mainly for my reference.

TFT display code

021/TFT code currently counts the amount of messages received using a primitive counter.

When the counter is full, it draws a black box over the first half of the screen, and resets the cursor position to the top.
The second time the counter fills, it draws a black box over the second half of the screen and resets cursor position to half way.

This is a crude way to see a "history" whilst re-writing over the pixels used.

  • counter is crap, use length of received string to determine point of reset
  • store last message and recolour grey when new message arrives
  • display separate area of refresh for Sensor information
  • dynamic drawing of black boxes, smaller and faster.

Make slaves react to clock pulses and bpm changes

Slave devices should be ready to receive a float from master indicating a change in BPM, They should also run a function on receiving a clock pulse from master


* @todo Make slaves react to clock pulses and bpm changes
* @body Slave devices should be ready to receive a float from master indicating a change in BPM, They should also run a function on receiving a clock pulse from master
*/
// Varidaic Debug Macro //
//#define DEBUG //Comment this line to disable Debug output


This issue was generated by todo based on a @todo comment in 17a607b when #45 was merged. cc @Squatnet.

Adding different ways of addressing LED strips.

Have changed the setup and declarations of I2CtoFastLEDs to allow addressing of multiple led strips via one array reference number.
ToDo
Need to still be able to address individually and copy exact LED sequence, from one strip to all.
This would need to depend on

  • if a bool was set to true (ie. if false address all strips under one array, if false address individual strips.)
  • be able to say which strip you wish to change pattern on.
  • be able to copy one strip to another, or all strips.
    Ref #44

library updates.

turns out i am currently working with libraries with updates available. as follows.

  1. Adafruit GFX Library. Current 1.3.6 : latest available 1.4.8.
  2. ArduinoJson. Current 6.7.0-beta : latest available 6.10.0.
  3. FastLED. Current 3.2.1 : latest available 3.2.6.

Question is. is there any reason for me not to update the above (nothing immediately springs to mind for me.) and if so, do you want me to update our working copies on the git.
cheers.

Old Tft, Ethernet, MAtrix code no longer available

Since changing from the arduino-pc-leds repo to this one, The files from the previous repo were kept in a submodule, This is no longer the case and this repo now contains those files but they are not tracked and do not get staged.

test

ksdffksdkdfskdf

General Repo Stuff

Just a place to do things like make others aware of Library updates, Created branches, Merge / Pull Requests, Closing branches, File renaming, So on.

Mirror mode

Some mirror modes and some patterns don't play together nicely. To be fiddled with.

Write code for Nano RS485 Hub (aNCS_LED_020/0b)

##Write code for a nano to act as a i2c > rs485 hub:

needs to do

  • receive an i2c message
  • send messages to 2 rs485 connections

###Could do

  • Serial output to TFT screen of network messages
  • Send and receive info on other connected devices (i2c, rs485, bluetooth)
    PDF Reference

Constrained timers for different patterns.

different patterns look better at different delays.
ToDo.
find and map appropriate constraints to FRAMES_PER_SECOND function to each pattern.
make this visible via the parser.
this can be applied to both matrix and strips

MASTER

The master device will be responsible for accepting incoming messages via bluetooth or OSC and sending those messages out to the correct device. Due to issues with how data is structured the decision was taken to halt development on PJON dynamic addressing until DV3.
The master device will most likely need to be a mega 2560 and will need to be able to parse both bluetooth messages (json) amd ethernet messages (osc) these messages will be transmit to a number of controllers (tree) which in turn will control 4 pro minis (branches)

  • Receive bluetooth mesage and parse JSON
  • Receive ethernet and parse OSC
  • Send messages on to correct device.
  • Receive and parse "ack" from devices after sending message.

Bluetooth mode

  • Connect via bluetooth to HC05
  • Display settings page
  • Allow adding devices
  • Allow removing devices
  • Plug and play
  • Allow control of all devices (strips, matrix)

Router resets

router to LED end seems to keep losing conectivity.

DV2 Network Master

The master device will be responsible for accepting incoming messages via bluetooth or PJON and sending those messages out to the correct device. DV2 is using dynamic addressing. The master assings an ID # to the slave, and awaits the slave registering, Registered slaves are kept in an array of structs, as mentioned in #13
The master device will most likely need to be a mega 2560 and will need to be able to parse both bluetooth messages and PJON messages these messages will be transmitted to a number of other devices via PJON softwareBitBang

  • Register different device types with name and id (see #13)
  • Remove devices that disconnect
  • Receive bluetooth message and parse
  • Receive PJON message and parse
  • Receive OSC clock signal from Pjon connected device #43
  • Send messages on to correct device
  • Allow sending to groups of devices by name, type, or both.

if you are bored and want a simple coding challenge.

Right so i have got the logic down for what i want to achieve, and it works beautifully.
Only issue is juicy nested if statement.
Any ideas on pruning this down?
Absolutely not a problem if you cant be arsed though hahaha.

static int pos1,pos2,pos3,pos4,posR,shapeNumber;
int numberOfShapes = 4;
EVERY_N_MILLISECONDS(1000){
	shapeNumber=random8(0,2);//square or circle +1 cus ? but works.
	colorIndex=random8(1,255);//color of shape
	pos1=random8(1,MATRIX_WIDTH);//starting x coord
	pos2=random8(2,MATRIX_HEIGHT);//starting y coord
	pos3=random8(1,MATRIX_WIDTH);//ending x coord
	pos4=random8(2,MATRIX_HEIGHT);//ending y coord
	posR=random8(1,(MATRIX_HEIGHT));//radius for circle
	if (shapeNumber==0){//purpose i want there to be at least 1 line of blank pixles in each rectangle
//draw, so i check if the difference in coordinates allows this, and if not edit to do so.
		if (pos1>=pos3){
			if((pos1-pos3)<2){
				if ((pos1-pos3)==1){
					pos1=pos1+1;
				}
				else{
					pos1=pos1+2;
				}	
				
			}
			
		}
		if (pos3>=pos1){
			if((pos3-pos1)<2){
				if ((pos3-pos1)==1){
					pos3=pos3+1;
				}
				else{
					pos3=pos3+2;
				}	
				
			}
			
		}
		if (pos2>=pos4){
			if((pos2-pos4)<2){
				if ((pos2-pos4)==1){
					pos2=pos2+1;
				}
				else{
					pos2=pos2+2;
				}	
				
			}
			
		}
		if (pos4>=pos2){
			if((pos4-pos2)<2){
				if ((pos4-pos2)==1){
					pos4=pos4+1;
				}
				else{
					pos4=pos4+2;
				}	
				
			}
			
		}
	}
	switch (shapeNumber){//draw the shape.
		case 0:
			matrix.DrawRectangle(pos1,pos2,pos3,pos4,ColorFromPalette( currentPalette, colorIndex, brightness, currentBlending));
			break;
		case 1:
			matrix.DrawCircle(pos2,pos2,posR,ColorFromPalette( currentPalette, colorIndex, brightness, currentBlending));  
			break;
	}
}
EVERY_N_SECONDS(14){//wipe the screen
	turnOff();
	setLEDs();
}
FastLED.show();   
FastLED.delay(20);

}

Make slaves react to clock pulses and bpm changes

Slave devices should be ready to receive a float from master indicating a change in BPM, They should also run a function on receiving a clock pulse from master


* @todo Make slaves react to clock pulses and bpm changes
* @body Slave devices should be ready to receive a float from master indicating a change in BPM, They should also run a function on receiving a clock pulse from master
*/
// Varidaic Debug Macro //
#define DEBUG //Comment this line to disable Debug output


This issue was generated by todo based on a @todo comment in 17a607b when #45 was merged. cc @Squatnet.

Fix regString Needs trailing space

regString should not need a trailing space, Possibly caused by setting to small an array in string.toCharArray()


* @todo Fix regString Needs trailing space
* @body regString should not need a trailing space, Possibly caused by setting to small an array in string.toCharArray()
*/
#include <Wire.h>
// PJON stuff //
#define PJON_INCLUDE_SWBB


This issue was generated by todo based on a @todo comment in 2f9f995 when #53 was merged. cc @Squatnet.

Demo 2 fix list

  • sending matX message shuts down board B
  • find out why strip PSUs did not work (fingers crossed its just something simple)
  • Scroll text updating still not right. possible fix by forcing pattern 0 before showing ptrn 9
  • HC05 tx/rx needs securing / master needs larger enclosure?

Moved to DV2
- [x] Add a mode to allow automatic color but not pattern... (enhancement)
- [x] Implement ALLX page on Godot App ( and fix it up a bit )

2560PROPjonMast getDeviceByName(String, String) changes

Should return an array of ints rather than just a single int, Create new constructor that allows only name, making function search all devices rather than just a single type. (group control)


* @todo 2560PROPjonMast getDeviceByName(String, String) changes
* @body Should return an array of ints rather than just a single int, Create new constructor that allows only name, making function search all devices rather than just a single type. (group control)
*
*/
#include <PJON.h>
#include <SoftwareSerial.h>


This issue was generated by todo based on a @todo comment in 17a607b when #45 was merged. cc @Squatnet.

Struct? Class?

This is a place for me to write pseudocode relatg to building a system to store and recover devices registered on pjon network

int id = 3;
char * name = "Hello";

struct device {
   int id;
   char * name;
   };
device devA=  {3, "HELLO"};
device devB = {2, "hi"};
devA.id = 5;
device devC ={ (devB.id+devA.id) , (devA.name+" - "+devB.name)}

pattern issues.

Place to document current pattern bugs, and tick them off when completed.

  • Strobe doesn't seem to cycle the palette correctly.
  • Retracting shapes, circle retract not working. math doesn't look quite right.
  • BouncingTrails. as we are on an even array, the spawn point doesn't seem correct. one of the directions bounces from one away from the far end instead of at the far end.
  • Implement #74 into randShapes.

Godot App Pallette Parser

I created a script to parse pallettes into the app exactly as they would be expected to be written for FastLEDS. on its first run the app detects that it doesnt know any pallettes and opens a text file from the internal app storage. def_pallettes.txt it expects this file to contain pallettes written like this (note the semicolon after function definition closes, this is important)

DEFINE_GRADIENT_PALETTE( Pastel1_08_gp ) {//group 1
  0, 244, 118, 98,
  31, 244, 118, 98,
  31, 101, 157, 190,
  63, 101, 157, 190,
  63, 142, 213, 133,
  95, 142, 213, 133,
  95, 177, 154, 192,
  127, 177, 154, 192,
  127, 252, 178, 87,
  159, 252, 178, 87,
  159, 255, 255, 145,
  191, 255, 255, 145,
  191, 192, 176, 120,
  223, 192, 176, 120,
  223, 249, 180, 210,
  255, 249, 180, 210
};

it will parse them, (dropping the first column) and add them to its internal pallette dictionary (basically converts them to JSON) with its name.
new pallettes can be added by creating a file in the user data directory called user_pallettes.txt which is written in exactly the same way. pallettes with names which match an existing pallette will replace the exisiting pallette. the file is parsed by clicking the button in settings to parse pallettes ( you will need to reload an open device once new pallettes are parsed )

Automated issue creation

These lines of comment will automatically create an issue when being commited"


* @todo Automated issue creation
* @body These lines of comment will automatically create an issue when being commited"
*/
void setup() {
// put your setup code here, to run once:


This issue was generated by todo based on a @todo comment in d965d79. It's been assigned to @Squatnet because they committed the code.

MArtix aNCS_LED_2560

Led matrix with i2c

Needs to

  • I2c command and change patterns on matrix
  • receive a string via i2c and update scrolling text.

could do

  • report matrix back to phone via #6 periodically (#6 would need to support this as would the app)
  • connect to other matrixes to create a much larger matrix
  • display text from a live twitter feed #letmetakeaselfieeee Standalone

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.