Show Posts
Pages: [1]
1  Using Arduino / Programming Questions / Re: Attiny refuses to Multiply ( core) on: April 04, 2014, 04:09:51 pm

found out that the damn ld file is inside inside

Im gonna try build it from the source and see if that version works (i doubt it '3 years ago Updating to avrdude 5.11 on Mac OS X.')

if dosen't work
then im gonna fork the damn thing and apply the ld file inside the zip and build it... might try to submit a patch then... or just use my forked one.. i don't intend to use 1.5 while still beta..

2  Using Arduino / Programming Questions / Re: Attiny refuses to Multiply ( core) on: April 04, 2014, 03:40:27 pm
Thank you dear Moderator,

Found exactly the problem at

didn't try the fix yet, but yes it only happens on macs, just compiled the sketch on a Linux box and works fine...

So the problem is in the arduino for mac itself?
3  Using Arduino / Programming Questions / Re: Attiny refuses to Multiply on: April 04, 2014, 02:36:01 pm
You are right, i might add something to just dont do nothing if that occurs smiley

4  Using Arduino / Programming Questions / Re: Attiny refuses to Multiply on: April 04, 2014, 02:28:18 pm

the greyDiff wont get 0 or below, because of the values that are read from the analog port...

anyway, i found a solution....

my sketch size was 5.404 bytes (max on attiny is 8.192)

And i noticed that all started when i changed the core to to use software serial (only need tx)

So, i tried to change from SoftwareSerial to TinyDebugSerial using arduino-tiny library from

Now im running my old code line the one that started the error
colourArray[i] = (colourArray[i] - blackArray[i]) / (greyDiff *255) ;

The result is that, all works fine now and the sketch size is 3.874 bytes.

I still believe the problem is within the core of attinys implementation, and i also opened a issue there
5  Using Arduino / Programming Questions / Re: Attiny refuses to Multiply on: April 04, 2014, 07:25:50 am
PaulS, thanks for the reply!

Look what i've done and still have the error:

float greyDiff = whiteArray[i] - blackArray[i];
float temp =  greyDiff * 255.0;
float temp2 = colourArray[i] - blackArray[i];
colourArray[i] = temp2 / temp;

Cant break the code simpler than that!
if i comment the last line "colourArray = temp2 / temp;"
it compiles fine!
even if i set a float variable for the 255, still gives the same error.

Im blaming attiny because it works fine on Uno or NANO. (if i change the board, works fine!!)
I am no genius, i might be doing something wrong but i cant figure out!

Thanks again!
6  Using Arduino / Programming Questions / Attiny refuses to Multiply ( core) on: April 04, 2014, 06:59:11 am
Guys, im having the weirdest problem ever...

I programming a attiny using this core (so i can use SoftwareSerial) and using a Arduino 1.0.5 IDE
I set the board to Attiny85 (internal 8mhz)
The problem is with this line
colourArray[i] = (colourArray[i] - blackArray[i])/ (greyDiff * 255)

Here are the variable declarations
float colourArray[] = {0,0,0};
float whiteArray[] = {0,0,0};
float blackArray[] = {0,0,0};
float greyDiff = whiteArray[i] - blackArray[i];

The problem is exactly with the * 255, if i remove it, it works (in fact if i change 255 to 5 it still gives me the erros, but if i change to 1 or 2, it works)

here is the error:
/Applications/ relocation truncated to fit: R_AVR_13_PCREL against symbol `exit' defined in .fini9 section in /Applications/

btw.. it works fine on arduino nano or uno. so ive got to be something with the attiny!

well, just some headsup, i did try a few changes but still the same, now i dosent dive temp2 / temp if the * 255 is there

float temp = 255 * greyDiff;
     float temp2 = colourArray[i] - blackArray[i];
     colourArray[i] = temp2 / temp

Tkz for the help guys! and keep the community alive smiley
7  Using Arduino / LEDs and Multiplexing / TLC5940 + VirtualWire, problems on: October 14, 2013, 09:29:45 am
Hello all,

Im using RF to talk betweeen two arduinos, to light up some leds using TLC5940.

the RF Part is ok, the server send the data and the receiver receives it and display in my serial output

Then i merged the TLC stuff with the receiver.

Then i got a problem, the TLC overwrites the VirtualWire.

I changed the ports on TLC
BLANK -> PB2 (D10)
XLAT -> PB1 (D9)
SIN -> PD7 (D7)
XERR -> PD6 (D6)
SCLK -> PD4 (D4)
GSCLK -> PD3 (D3)

Edited the tlc_config.h  and setted

Then switched the virtualwires to tx 0, rx 1 then rx to 8, but any case the problem remains the same

When i upload the scketch, commenting the TLC.init(), the virtualwire works fine, but if i leave uncommented the virtualwire stops receiving the data.

The tlc is working fine, just overrinding, or messing with the virtualwire.

Im attaching the source, but dunno if it will help.

any thoughts? Thanks for the help!

#include "Tlc5940.h"
#include <VirtualWire.h>

int pinR[12] = {0,3,6,9,12,15,18,21,24,27,30,33};
int pinG[12] = {1,4,7,10,13,16,19,22,25,28,31,34};
int pinB[12] = {2,5,8,11,14,17,20,23,26,29,32,35};

int hourForecast[12] = {10,11,10,11,10,10,10,10,11,10,10,10};

char dados[] =  "110212011301140115031603170318021902200221012201";

void setup() {
  vw_setup(2000); // Bits per sec


void loop() {
    uint8_t buf[VW_MAX_MESSAGE_LEN];
    uint8_t buflen = VW_MAX_MESSAGE_LEN;

    if (vw_get_message(buf, &buflen)) // Non-blocking
int i;

        //digitalWrite(13, true); // Flash a light to show received good message
// Message with a good checksum received, dump it.
Serial.print("Got: ");

//char dados[i];
for (i = 0; i < 47; i++)
            dados[i] = buf[i];
        //digitalWrite(13, false);

void setForecast(){
   for(int i = 0; i <= 44; i = i+4){
    int hora = (String(dados[i]).toInt()*10 )+  (String(dados[i+1]).toInt());
    int dado = (String(dados[i+2]).toInt()*10 )+  (String(dados[i+3]).toInt());
   if(hora >= 12){
     hora = hora - 12;
    hourForecast[hora] = dado;

void setLights(){
  for(int i=0; i <= 11; i++){
    if(hourForecast[i] >= 1 && hourForecast[i] <=2){
      Tlc.set(pinR[i], ((4095 * 255) / 255));
      Tlc.set(pinG[i], ((4095 * 255) / 255));
      Tlc.set(pinB[i], ((4095 * 0) / 255));
    } else if(hourForecast[i] >= 3 && hourForecast[i] <=6){
     Tlc.set(pinR[i], ((4095 * 102) / 255));
     Tlc.set(pinG[i], ((4095 * 255) / 255));
     Tlc.set(pinB[i], ((4095 * 255) / 255));
8  Using Arduino / Networking, Protocols, and Devices / SainSmart WiFi Shield doesnt work on: August 13, 2013, 10:04:27 am

 i need help smiley ive bought the SainSmart WiFi Shield, but i never been able to use it smiley-sad

Ok, i can get the WIZSmartScript, and configure to access my route, my other pcs can ping the damn thing....

But what i need, is just put it in arduino, and transmit some sensors data to a website, simple webclient stuff..

i tried the

but every example gives me the sync data timeout smiley-sad

Any ideias please? Im stuck smiley-sad
9  Using Arduino / LEDs and Multiplexing / Re: TLC5940, cant fade more than 12 pins at the same time? on: August 07, 2013, 06:08:31 am
Thanks john!! works great!

now im with another problem hehe... how the heck can i realize that the fade stoped (like 1 fade) then make it do another thing, like stay still, or do another fade in another pins?

the only problem is that i cant figure out how to stop it at the end.

Any ideias?

The big picture, im creating a led tree, show it should fade all the time, very smoothly and in a long period of time, and stay switching colors.

If only i knew how to stop the fade at the end of it.
10  Using Arduino / LEDs and Multiplexing / TLC5940, cant fade more than 12 pins at the same time? on: August 06, 2013, 10:19:08 am
Guys... im a bit lost here...

Im building a small led tree, using TLC5940 and RGB leds

im trying to fade 16 rgb leds at the same time, at the beginning only the blue pins...

when i ran the fade example. it all works ok. But then i try to fade all the blue pins (or, red, green, dosent matter wich), i just only fade the first 12 ones...

here is my code:

#include "Tlc5940.h"
#include "tlc_fades.h"

int pinR[16] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
int pinG[16] = {1,4,7,10,13,16,19,22,25,28,31,34,37,40,43,46};
int pinB[16] = {2,5,8,11,14,17,20,23,26,29,32,35,38,41,44,47};

int i = 0;

void setup()

void loop(){

    if (!tlc_isFading(pinB[0])) {
        uint16_t duration = 3000;
        int maxValue = 4095;
        uint32_t startMillis = millis() + 50;
        uint32_t endMillis = startMillis + duration;
        for(int a =0; a < 16; a++){
          tlc_addFade(pinB[a], 0, maxValue, startMillis, endMillis);
          tlc_addFade(pinB[a], maxValue, 0, endMillis, endMillis + duration);


im using the library    Latest Stable Build as of May 7th, 2009

thanks for the help!
11  International / Portugues / Re: sensor LM35 retornando valor negativo on: October 03, 2012, 08:46:07 am
o fonte é simples...

to suspeitando que seja algum mal funcionamento no sensor... pois é bem esporadico esse problema, tem hora que do nada comeca a soltar valor negativo.. tipo de 30 para -30
12  International / Portugues / sensor LM35 retornando valor negativo on: October 02, 2012, 11:30:41 am

Estou aprendendo sobre o arduino... cheguei naquele ponto de aprender a usar o sensor de temperatura LM35

Beleza, funciona tudo bem.. ele le os valores... so que do nada, derrepende de 30, ele comeca a retornar pela serial -30

e fica nessa de mandar valor negativo....

nao... nao esta tao frio assim...

é normal ele fazer isso? devo converter tudo p/ positivo? tem alguma funcaozinha que ja faz isso?

Tesso M .Costa
Pages: [1]