Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - robrlstn

Pages: 1
1
General Discussion / Re: Hi and I have questions.
« on: March 06, 2014, 11:18:52 PM »
Behavior of my boards:

1. TinyDuino by itself.  Putting 1632 battery in makes green LED blink once.  Pressing and releasing restart button makes green LED blink once.

2. Same behavior with TinyShield USB board attached.

3. TinyDuino + USB board, no battery. Plugging it into USB power makes green LED blink 8 times, both RX and TX amber LEDs on USB board blink twice. Pressing restart button makes green LED blink once. (running Windows 8.1, assume behavior would be the same with other OS or versions.)

Don't understand avrdude error, someone else probably will.  The AVR MEGA328p chips, when from Arduino or an Arduino type board (TinyCircuits) do have code on them, the bootloader code, which is what allows the sketch to be uploaded. I don't know if this code is locked or not, i.e. whether it can be overwritten from an Arduino sketch, but if using Arduino sketches, one generally does not want to do that, you want and need that bootloader code in there.

However, any other sketch code loaded previously will not matter and will be overwritten (leaving the bootloader code untouched).

 If, under Tools, you have definitely chosen the correct Port and the correct Board (Arduino Pro or Pro Mini), then I do not know.

2
User Projects / Code Examples / Re: TinyDuino Darkness Gauge
« on: February 21, 2014, 08:03:22 PM »
Thank you for posting this code.  I was going to write similar code to support Charlieplexing using the switch / case statement but I suspect my attempt would have been clumsy.

When using the Charlieplexing library, I do not know how to select a CharlinPin at random, so had to go with not using that library.

3
User Projects / Code Examples / TinyDuino Sparkler
« on: February 21, 2014, 08:00:12 PM »
Make the TinyShield 16 Edge LEDS sparkle. Through each loop a LED is chosen at random and its on-time delay also chosen at random. http://www.youtube.com/watch?v=rwu3iNypoQ0.

The code below is slightly modified code from the TinyDuino Darkness Guage by @tamberg (thank you).

Code: [Select]
// Sparkler (TinyDuino plus TinyShield 16 Edge LEDS) Feb 2014 robrlstn
// One LED at a time choosen at random and on-time rnadom delay
// Majority of code is from TinyDuino Darkness Guage by @tamberg, 14.04.2013
// on TinyCircuits » TinyCircuits Products » User Projects / Code Examples


int wait[5] = {60,40,20,10,5};
void setLedRaw (int px, int wx, int py, int wy,
  int m5, int m6, int m7, int  m8, int m9)
{
  digitalWrite(px, wx);
  digitalWrite(py, wy);
  pinMode(5, m5);
  pinMode(6, m6);
  pinMode(7, m7);
  pinMode(8, m8);
  pinMode(9, m9);     
}

void setLed (int i) {
  switch (i) {
    case 1: setLedRaw(5, HIGH, 6, LOW, OUTPUT, OUTPUT, INPUT, INPUT, INPUT); break;
    case 2: setLedRaw(5, LOW, 6, HIGH, OUTPUT, OUTPUT, INPUT, INPUT, INPUT); break;
    case 3: setLedRaw(5, HIGH, 7, LOW, OUTPUT, INPUT, OUTPUT, INPUT, INPUT); break;
    case 4: setLedRaw(7, HIGH, 5, LOW, OUTPUT, INPUT, OUTPUT, INPUT, INPUT); break;
    case 5: setLedRaw(6, HIGH, 7, LOW, INPUT, OUTPUT, OUTPUT, INPUT, INPUT); break;
    case 6: setLedRaw(7, HIGH, 6, LOW, INPUT, OUTPUT, OUTPUT, INPUT, INPUT); break;
    case 7: setLedRaw(6, HIGH, 8, LOW, INPUT, OUTPUT, INPUT, OUTPUT, INPUT); break;
    case 8: setLedRaw(8, HIGH, 6, LOW, INPUT, OUTPUT, INPUT, OUTPUT, INPUT); break;
    case 9: setLedRaw(5, HIGH, 8, LOW, OUTPUT, INPUT, INPUT, OUTPUT, INPUT); break;
    case 10: setLedRaw(8, HIGH, 5, LOW, OUTPUT, INPUT, INPUT, OUTPUT, INPUT); break;
    case 11: setLedRaw(8, HIGH, 7, LOW, INPUT, INPUT, OUTPUT, OUTPUT, INPUT); break;
    case 12: setLedRaw(7, HIGH, 8, LOW, INPUT, INPUT, OUTPUT, OUTPUT, INPUT); break;
    case 13: setLedRaw(9, HIGH, 7, LOW, INPUT, INPUT, OUTPUT, INPUT, OUTPUT); break;
    case 14: setLedRaw(7, HIGH, 9, LOW, INPUT, INPUT, OUTPUT, INPUT, OUTPUT); break;
    case 15: setLedRaw(9, HIGH, 8, LOW, INPUT, INPUT, INPUT, OUTPUT, OUTPUT); break;
    case 16: setLedRaw(8, HIGH, 9, LOW, INPUT, INPUT, INPUT, OUTPUT, OUTPUT); break;
    default: setLedRaw(5, LOW, 6, LOW, OUTPUT, OUTPUT, INPUT, INPUT, INPUT); // off
  }
}

void setup () {
  pinMode(5, INPUT);
  pinMode(6, INPUT);
  pinMode(7, INPUT);
  pinMode(8, INPUT);
  pinMode(9, INPUT);
}

void loop () {
  int i = random(0,17);
  int RandNum2 = random(0,5);
  setLed(i);
  delay(wait[RandNum2]);
}

4
TinyDuino Processors & TinyShields / Re: Charlieplexing Library
« on: February 14, 2014, 01:39:56 AM »
Ok, I think I figured this out (but not yet extensively tested).

The example included with the Charlieplex library, SimpleCharlie.pde, now compiles and runs. Also, a simple program I wrote now also runs using that library.

The problem was in the header file, Charlieplex.h.  In there, I changed the statement #include <wProgram.h> to #include <Arduino.h>, following the 'Writing a Library for Arduino" article.

Apparently, this change, from wProgram.h to Arduino.h was made in some earlier version of the Arduino code.

5
Thanks for clip. I was glad to learn about the code corrections from Ken for the CardInfo example as my 8 GB SDHC card kept being reported as 4 GB. Other comments on the YouTube clip.

6
TinyDuino Processors & TinyShields / Charlieplexing Library
« on: February 11, 2014, 10:00:17 PM »
I've got the TinyShield 16 Edge LEDs board working (please see the short TinyDuinoEdgeLeds clip at:http://www.youtube.com/user/robrlstn/videos.

Code is modification of example on TinyCircuits tutorial page.

PROBELM:  I cannot get the Charlieplexing Library to work at all. I have downloaded that library, put it unzipped into the Arduino/libraries folder, and imported the Library so I can get the #include <Charlieplex.h> statement added to a sketch.

But the example included with that library, SimpleCharlie.pde, will itself not compile, throwing many errors with Arduino 1.0.5.

As an Arduino newbie, I cannot troubleshoot the meaning of these errors. So I cannot tell if I'm doing something wrong or that library has problems.

Thank you in advance for any help.  Robert

Errors:

In file included from _16LEDs_CPlib_1.ino:1:
C:\Users\RR\Documents\Arduino\libraries\Charlieplex/Charlieplex.h:14: error: 'byte' does not name a type
C:\Users\RR\Documents\Arduino\libraries\Charlieplex/Charlieplex.h:15: error: 'byte' does not name a type
C:\Users\RR\Documents\Arduino\libraries\Charlieplex/Charlieplex.h:26: error: expected `)' before '*' token
C:\Users\RR\Documents\Arduino\libraries\Charlieplex/Charlieplex.h:30: error: 'byte' has not been declared
C:\Users\RR\Documents\Arduino\libraries\Charlieplex/Charlieplex.h:31: error: 'byte' has not been declared
C:\Users\RR\Documents\Arduino\libraries\Charlieplex/Charlieplex.h:36: error: 'byte' does not name a type
C:\Users\RR\Documents\Arduino\libraries\Charlieplex/Charlieplex.h:37: error: ISO C++ forbids declaration of 'byte' with no type
C:\Users\RR\Documents\Arduino\libraries\Charlieplex/Charlieplex.h:37: error: expected ';' before '*' token
_16LEDs_CPlib_1:4: error: no matching function for call to 'Charlieplex::Charlieplex(byte [5], int)'
C:\Users\RR\Documents\Arduino\libraries\Charlieplex/Charlieplex.h:20: note: candidates are: Charlieplex::Charlieplex()
C:\Users\RR\Documents\Arduino\libraries\Charlieplex/Charlieplex.h:20: note:                 Charlieplex::Charlieplex(const Charlieplex&)
_16LEDs_CPlib_1:5: error: too many initializers for 'charliePin'
_16LEDs_CPlib_1:6: error: expected `}' before ')' token
_16LEDs_CPlib_1:6: error: too many initializers for 'charliePin'
_16LEDs_CPlib_1:6: error: expected ',' or ';' before ')' token
_16LEDs_CPlib_1:9: error: expected initializer before 'void'

Pages: 1
SMF spam blocked by CleanTalk