Show Posts
Pages: [1] 2 3 4
1  Forum 2005-2010 (read only) / Troubleshooting / Re: TimerOne Library - Sketch not compiling on: June 16, 2010, 06:11:43 am
Sorry for any inconvenience but I've solved the problem.

I didn't have the correct board selected in the tools menu.

All working fine now.

2  Forum 2005-2010 (read only) / Troubleshooting / TimerOne Library - Sketch not compiling on: June 16, 2010, 05:32:13 am
I recently downloaded and installed the TimerOne Library but get the following error when trying to compile.

I've tried re-importing the library but still won't compile.

Can anyone advise a possible solution?

Thanks in advance



3  Forum 2005-2010 (read only) / Troubleshooting / Re: Can't compile in Mac OS 10.6.1 Snow Leopard? on: September 25, 2009, 04:17:49 am
mellis

You're a genius. That fixed the problem!

Thanks a million. I can now go back and enjoy 0017.

Thanks again.
4  Forum 2005-2010 (read only) / Troubleshooting / Re: Can't compile in Mac OS 10.6.1 Snow Leopard? on: September 24, 2009, 08:32:20 pm
Sorry mellis

It wasn't meant as an angry request. I'll go much easier on the red and bold next time.

Thanks for your suggestion. Will try it once I get back to my laptop.

Thanks again.
5  Forum 2005-2010 (read only) / Troubleshooting / Re: Can't compile in Mac OS 10.6.1 Snow Leopard? on: September 22, 2009, 06:10:17 pm
Thanks Professor Chaos, my mum always said that Professors are smart!





I checked the info.plist file and there is indeed a note which states "currently no 64 bit support"

Snow Leopard is now 64 bit so I guess that means I'll have to wait for 0018 OR do you think the .plist file can be adjusted?

If Arduino0017 is definately 32 bit only, then it's probably a good idea that Mac OS users are notified.

David Mellis, can you please confirm?

Thanks again
6  Forum 2005-2010 (read only) / Troubleshooting / Re: Can't compile in Mac OS 10.6.1 Snow Leopard? on: September 22, 2009, 07:18:41 am
Tried the "get info" idea but Arduino0017 doesn't include a checkbox for 32 or 64 bit mode.

I've also tried changing the build path as per the error message and still no luck.

Is anybody else running 0017 on Snow Leopard??????

Guess I'll have to stick with 0016.
7  Forum 2005-2010 (read only) / Troubleshooting / Re: Can't compile in Mac OS 10.6.1 Snow Leopard? on: September 21, 2009, 07:11:54 pm
Thanks Grumpy_Mike

I'll try that when I get home. FYI, If I do a "Get Info" on the app on my other computer (G5, not running Snow Leopard), the 64 and 32 bit mode check box isn't there.
8  Forum 2005-2010 (read only) / Troubleshooting / Re: Can't compile in Mac OS 10.6.1 Snow Leopard? on: September 21, 2009, 04:56:54 am
A screen grab of the error messages.
9  Forum 2005-2010 (read only) / Troubleshooting / Can't compile in Mac OS 10.6.1 Snow Leopard? on: September 21, 2009, 04:53:46 am
Just upgraded my MacBook Pro to Snow Leopard and programs no longer compile when using Arduino0017. The same sketches were compiling without any problem before I upgraded. 0016 still works fine.

I've reinstalled the Arduino0017 app and the latest FTDI drivers but problem still persists.

Also, I can't find the Arduino preferences file (as mentioned in the fault report.

Anyone else having similar issues?

Thanks in advance.
10  Forum 2005-2010 (read only) / Troubleshooting / Re: random led blink on: March 17, 2008, 06:06:43 pm
Hi graybeard

Just saw your post and thought this might help. It currently lights up 20 leds in random order. I've also had it working for 40 leds on a Wiring board.

I used this program to teach myself some basics which is why it has some very obvious // comments //.

Hope it helps.

// Random LED Display 3 (common anode OR common cathode)
// by Sid Guglielmino 29/02/2008
// Turns 20 leds on in random order according to variable i


// SET UP --------------------------------------------------------------
int i;                      // variable that holds pin number for
                            // initialising pins as output
                            // and turning all pins off at startup
                            // and turning pins ON randomly

void turn_all_off() {       // turn all pins OFF
  for(int i=0; i<20; i++) {
    digitalWrite(i, LOW);
  }
}

void setup() {
  for(int i=0; i<20; i++) {  // initialize pins 0 to 20 as outputs
    pinMode(i, OUTPUT);
  }
}
// END OF SET UP --------------------------------------------------------



// START OF PROGRAM -----------------------------------------------------
void loop() {
  turn_all_off();           // to turn all pins/leds OFF
  i = random(20);           // Sets i to a random number between 0 and 20
  digitalWrite(i, HIGH);    // turn random pin/led ON
  delay(20);                // wait for a bit  
}
// GO BACK TO START OF PROGRAM AND REPEAT --------------------------------

11  Forum 2005-2010 (read only) / Syntax & Programs / Re: If Value has changed... on: June 03, 2008, 08:43:48 pm
This might help.

I wrote this for a remote control project.

Basically you set up a variable (see "int i = 0;" in my code).

Then use "i = i+1;" (in loop) to increment the value

Then use the "If" statement to check the value of "i" and add whatever action you want.

You can also reset the value of "i" when it reaches a certain number of your choosing.

Example

if (i >= 4) {
i = 0;

Hope that helps.


Code:
// IR Receiver 6

// by Sid Guglielmino
// Created 30 May 2008

// A Remote Control sends IR signal to an IR Sensor
// Output from the sensor turns on a LED on Pin 2

// Lights up 1, 2 or 3 leds according to number of Remote Control button presses
// First press lights led 1, second press lights led 2 etc
// Fourth button press turns all off and in reverse sequence

// Uses IR Receiver Module RPM7100 series ZD 1952 Ex Jaycar
// Sensor Pin 1 Output, Pin 2 GND, Pin 3 Vcc

// WORKS OK


int sensorOutput = 0;                                // select ANALOGUE input pin for the IR sensor Output Pin
int ledPin1 = 5;                                     // select the pin for the LED
int ledPin2 = 6;
int ledPin3 = 7;
int val = 0;  
int amp = 0;
int i = 0;                                           // Variable to store number of signals received
  
void setup() {  
  pinMode(ledPin1, OUTPUT);                           // declare the ledPin as an OUTPUT
  pinMode(ledPin2, OUTPUT);                           // declare the ledPin as an OUTPUT
  pinMode(ledPin3, OUTPUT);                           // declare the ledPin as an OUTPUT
}  
  
void loop() {  
  
  val = analogRead(sensorOutput);  
  amp = (val >= 1024) ? val - 1024 : 1024 - val;
    
  if (amp > 1000) {  
    digitalWrite(ledPin1, HIGH);                      // If IR signal detected turn on ledPin        
    delay(400);                                       // Ignore IR signal for a short time
    i = i+1;                                          // Acts like a button debouncer
  }                                                   // because Remote Controls send repeating pulsing signal


if (i == 2) {  
   digitalWrite(ledPin2, HIGH);                      // If IR signal detected 3 times, turn on ledPin2
}


if (i == 3) {
   digitalWrite(ledPin3, HIGH);  
}

if (i >= 4) {
   digitalWrite(ledPin3, LOW);
   delay(500);
   digitalWrite(ledPin2, LOW);
   delay(500);
   digitalWrite(ledPin1, LOW);
   delay(500);
    i = 0;
    
}
 
}



12  Forum 2005-2010 (read only) / Syntax & Programs / Re: Please help with MAX7219 7 segment driver code on: June 03, 2008, 04:13:47 am
Thanks for the tip.
13  Forum 2005-2010 (read only) / Syntax & Programs / Please help with MAX7219 7 segment driver code on: June 03, 2008, 01:09:21 am
I've been trying to finalise some code to drive a multiplexed, 4 digit, seven segment display using the MAX7219 chip. The code below was made from various elements in the Led Contol Playground Article but can't get it to compile correctly.
 
The Arduino IDE throws the following error:
 
"too few arguments to function 'void printNumber(int)'
 
Does anyone know what is wrong with that part of the code?
 
Thanks in advance.
Code:
// Prints an int value (-999..999) on a display with 4 digits

#include "LedControl.h"

/*
 pin 12 is connected to the DataIn
 pin 11 is connected to the CLK
 pin 10 is connected to LOAD
 Using a single MAX7219
 */
 
LedControl lc=LedControl(12,11,10,1);
unsigned long delaytime=250;

void setup() {
  lc.shutdown(0,false);   // MAX72XX is in power-saving mode on startup, do a wakeup call
  lc.setIntensity(0,8);   // Set the brightness to a medium values
  lc.clearDisplay(0);     // clear the display
}

void printNumber(int v) {
    int ones;
    int tens;
    int hundreds;
    boolean negative;      

    if(v < -999 || v > 999)
       return;
    if(v<0) {
        negative=true;
        v=v*-1;
    }
    ones=v%10;
    v=v/10;
    tens=v%10;
    v=v/10;
    hundreds=v;                  
    if(negative) {
             
       lc.setChar(0,3,'-',false);   //print character '-' in the leftmost column
    }
    else {
      
       lc.setChar(0,3,' ',false);   //print a blank in the sign column
    }
    
    lc.setDigit(0,2,(byte)hundreds,false);   // Print the numbers digit by digit
    lc.setDigit(0,1,(byte)tens,false);
    lc.setDigit(0,0,(byte)ones,false);
}



void scrollDigits() {           // Scroll all the hexa-decimal numbers and letters
  for(int i=0;i<13;i++) {
    lc.setDigit(0,3,i,false);
    lc.setDigit(0,2,i+1,false);
    lc.setDigit(0,1,i+2,false);
    lc.setDigit(0,0,i+3,false);
    delay(delaytime);
  }
  lc.clearDisplay(0);
  delay(delaytime);
}

void loop() {
  printNumber();
  scrollDigits();
}

14  Forum 2005-2010 (read only) / Syntax & Programs / Re: Seven Segment Display code problem on: June 03, 2008, 01:32:39 am
Thanks very much Ben

I'll keep working on getting a better understanding of the code.

Appreciate your help.
15  Forum 2005-2010 (read only) / Syntax & Programs / Re: Seven Segment Display code problem on: June 03, 2008, 01:13:53 am
Thanks Ben

But I thought the 'void printNumber(int)' part of the code would print the numbers -999 through to 999?

I'm obviously missing something major. How should I modify the code in loop() ?
Pages: [1] 2 3 4