Show Posts
Pages: 1 [2]
16  Using Arduino / Microcontrollers / Re: Teensy 2.0 Teensy Loader Error on: February 22, 2013, 11:38:38 pm
Here is the verbose output of the loader.
22:29:56: Verbose Info event
22:30:24: remote connection opened
22:30:25: remote connection opened
22:30:25: remote connection opened
22:30:26: remote connection opened
22:30:26: remote connection opened
22:30:26: remote connection opened
22:30:27: remote connection opened
22:30:27: remote connection opened
22:30:27: remote connection opened
22:30:28: remote connection opened
22:30:28: remote connection opened
22:30:28: remote connection opened
22:30:29: remote connection opened
22:30:29: remote connection opened
22:30:29: remote connection opened
22:30:30: remote connection opened
22:30:30: remote connection opened
22:30:31: remote connection opened
22:30:31: remote connection opened
22:30:31: remote connection opened
22:30:32: remote connection opened
22:30:32: remote connection closed
22:30:32: remote connection closed
22:30:32: remote connection closed
22:30:32: remote connection closed
22:30:32: remote connection closed
22:30:32: remote connection closed
22:30:32: remote connection closed
22:30:32: remote connection closed
22:30:32: remote connection closed
22:30:32: remote connection closed
22:30:32: remote connection closed
22:30:32: remote connection closed
22:30:32: remote connection closed
22:30:32: remote connection closed
22:30:32: remote connection closed
22:30:32: remote connection closed
22:30:32: remote connection closed
22:30:32: remote connection closed
22:30:32: remote connection closed
22:30:32: remote connection closed
22:30:32: remote connection closed

So it opens crap tons of connections for some reason.
17  Using Arduino / Microcontrollers / Re: Teensy 2.0 Teensy Loader Error on: February 22, 2013, 08:08:18 pm
Win7 Pro x86 on laptop w/ Core2Duo 2GB RAM, using Windows Firewall.
I unzipped the Arduino software, installed Teensyduino on the versions I have.
If you want to look at my config files lemme know which ones to post.
18  Using Arduino / Microcontrollers / Re: Teensy 2.0 Teensy Loader Error on: February 22, 2013, 07:41:32 pm
It's not a problem with the boards, it's a problem with the software. The boards work perfectly, the cable works perfectly, the drivers are installed and are working properly. The HalfKey works perfectly (on the 2.0, the 2.0++ doesn't function like this).

The video in my first post shows what happens:
1) it compiles
2) creates a file in my temp directory
3) opens the Teensy Loader program (if it isn't open already)
4) error shows that asks if the loader is open

I can:
1) Program every board I have
2) Compile for every board
3) Load any program I have

I recently reset my router and reconfigured it. This is the only thing I did before this all happened.
19  Using Arduino / Microcontrollers / Re: Teensy 2.0 Teensy Loader Error on: February 22, 2013, 10:53:31 am
I said so in my first post.
20  Using Arduino / Microcontrollers / Re: Teensy 2.0 Teensy Loader Error on: February 22, 2013, 10:24:09 am
PJRC
21  Using Arduino / Microcontrollers / Teensy 2.0 Teensy Loader Error on: February 22, 2013, 10:16:14 am
I'm having a really confusing time right now.

I've never had any problems with the loader, in fact I've been using it for my Teensy++ 2.0 for months.
I plugged in the 2.0's I bought a week ago and now the loader doesn't work for either. Below is a video with this behavior.
http://www.youtube.com/watch?v=TeqohEXw2_o&feature=youtu.be

The IDE compiles for the Teensy 2.0, but I have to rummage through my temp folder to find the compiled hex manually with the loader.

To try and make sure it wasn't just the Arduino install, I now have 1.03, 1.53, and 1.02 (my original install) and I've installed the Teensyduino package on all of them.

Any ideas would be greatly appreciated.
22  Using Arduino / Programming Questions / [solved] Pick random #'s, shuffle 2d array;errors,invalid conversion on: September 27, 2012, 03:32:48 pm
So I have a compiler error and I don't know what to do with it. The error is below.
Code:
LCDArrayStylesEDIT.ino: In function 'int randomWriteArray2(char (*)[16])':
LCDArrayStylesEDIT:135: error: invalid conversion from 'int*' to 'int'
LCDArrayStylesEDIT:136: error: invalid types 'int [2][int [16]]' for array subscript

This function basically shuffles an array initialized with integers to generate a random pick.

orderCols[][] gets filled with 0 to cols-1, it's shuffled.
orderRows[] gets filled with 0 to rows-1, it's shuffled.
I then iterate over an array with chars called LCDarray[][] to print to the randomized locations by picking elements from LCDarray and placing them in the correct spot on the LCD with the values in the shuffled arrays.
Once orderRows[] is used completely it's reinitialized and shuffled to get more random picks until all cols are printed.

Code:
//pertinent declarations
#include <LiquidCrystal.h>
#define cols 16
#define rows 2
char LCDarray[rows][cols];

int randomWriteArray2(char LCDarray[][cols]){
  int j=0, k=0, r=0, temp=0;
  int orderCols[rows][cols];
  int orderRows[rows];
  //randomSeed(time);
  
  //fill orderCols with "0 to cols-1" for all rows
  for(j=0;j<rows;j++){
    for(k=0;k<cols;k++){
      orderCols[j][k]=k;
    }
  }
  
  //randomize orderCols
  for(j=0;j<rows;j++){
    for (k=0;k<cols;k++){
    r=random(cols);//pick random number from 0-cols
    temp=orderCols[j][k];//temp of swap area
    orderCols[j][k]=orderCols[j][r];//swap in selected number
    orderCols[j][r]=temp;//save temp number
    }
  }
  
  //fill orderRows with "0 to rows-1"
  for(k=0;k<rows;k++)orderRows[k]=k;
  //randomize elements
  for(k=0;k<cols;k++){
    r=random(rows);//pick random number from 0-cols
    temp=orderRows[k];//temp of swap area
    orderRows[k]=orderRows[r];//swap in selected number
    orderRows[r]=temp;//save temp number
  }

  //print by randomizing order rows each time and printing all cells in order
  int column,row;//extra variables for temporary readability
  for(j=0;j<cols;j++){
    for(k=0;k<rows;k++){
      column=orderCols[k];
      row=orderRows[orderCols[k]][k];
      lcd.setCursor(column, row);
      lcd.write(LCDarray[row][column]);
      delay(100);
    }
    //rerandomize row pick
    for(k=0;k<rows;k++)orderRows[k]=k;
    for(k=0;k<cols;k++){
      r=random(rows);//pick random number from 0-cols
      temp=orderRows[k];//temp of swap area
      orderRows[k]=orderRows[r];//swap in selected number
      orderRows[r]=temp;//save temp number
    }
  }
  wipeArray(LCDarray);
  return 0;
}
23  Using Arduino / Programming Questions / Re: Shuffle array of integers to randomize setCursor() & lcd.print() LiquidCrystal.h on: September 26, 2012, 06:11:07 pm
I placed markers into the program as Console.print() statements to track the integers it was sending to
Code:
    lcd.setCursor(orderCols[k],k%cols);//move cursor to xy
    lcd.write(LCDarray[k%cols][orderCols[k]]);//write LCDarray[y,x]
These are the values it gave me... I don't see any problem with the values.
It alternates between 0 and 1, oh... damnit I know what the problem is. I'm not tracking whether I printed (0,7) or something twice...

So I print the same spots more than once a random number of times... smiley-roll-blue

Code:
0,7

1,1

0,9

1,5

0,9

1,0

0,8

1,13

0,12

1,13

0,6

1,10

0,12

1,6

0,3

1,14

0,7

1,11

0,15

1,4

0,14

1,2

0,11

1,8

0,2

1,0

0,5

1,4

0,10

1,15

0,1

1,3

So that's the problem solved, now to find a way to implement that and still get my random numbers.
I guess I can generate a multidimensional array of 1-16.
24  Using Arduino / Programming Questions / Re: Shuffle array of integers to randomize setCursor() & lcd.print() LiquidCrystal.h on: September 26, 2012, 05:29:32 pm
No, like I said it shuffles fine.
col is columns, number of columns. I'm working on a 16x2 HD44780 type lcd on a Teensy++.
MAX is rows*cols.
So for my purposes cols=16, MAX=32
25  Using Arduino / Programming Questions / [solved]Shuffle array of integers to randomize setCursor() & lcd.print() on: September 26, 2012, 05:11:41 pm
I've written a little program that stores input from the serial console into an array
named LCDarray[rows][cols] and prints with the LiquidCrystal.h library.

I want the function below to initialize  a new array of int[MAX], shuffle that array,
and then select the cursor position and array position of LCDarray[][]
with the values inside the int[] array elements.


I understand I haven't seeded it, I'm working on getting it working for now  smiley-sad-blue
For my 'y' value I just alternate between 0 and 1. (random enough for now)

The function prints a (seemingly) random amount of the array LCDarray[][] and I'm wracking my brain trying to figure it out.


Code:
int randomWriteArray2(char LCDarray[][cols]){
  int k=0, r=0, temp=0, orderCols[MAX];

  //initialize array as "0"..."'cols-1'0"..."'cols-1'"
  for(k=0;k<MAX;k++)orderCols[k]=(k%cols);
  
  //randomize loop
  for (k=0;k<MAX;k++){
    //pick random number from 0-MAX
    r=random(MAX);
    //hold element k as temp
    temp=orderCols[k];
    //swap in randomly selected element
    orderCols[k]=orderCols[r];
    //replace randomly selected element with temp
    orderCols[r] = temp;
  }
  //LCD write loop
  for(k=0;k<MAX;k++){
    lcd.setCursor(orderCols[k],k%cols);//move cursor to xy
    lcd.write(LCDarray[k%cols][orderCols[k]]);//write LCDarray[y,x]
    delay(100);//for the random look effect
  }
  return 0;//this is the numChar counter, set to 0 so write functions will not write
}

In the hopes anyone could help I commented the crap out of it.
The LCDarray is properly loaded (I checked) and the orderCols[] array is properly shuffled (enough for me anyways) with no repeated numbers or lost numbers(0 to 15 x2), the damn thing just won't write to the LCD properly.
Pages: 1 [2]