Show Posts
Pages: 1 2 [3] 4 5 ... 75
31  Using Arduino / Project Guidance / Re: Problem programming ATtiny85 on: June 28, 2014, 07:30:36 am
To the OP.  A google search of your term "Arduino.h: No such file or directory" throws up many examples of others who have experienced this.  Most that I see have resolved the issue by using the Arduino-Tiny core (link to project and download) rather than the MIT one.  I did try the MIT one early on, but have used this Arduino-Tiny mostly.

As for the choice of using current-limiting resistors for your programming, that's a sensible thing I guess but I've never bothered.  I made up a shield for programming ATTiny and the only resistors there are for the LEDs.  But I digress - the resistors are a red herring and will not assist in solving your present situation.  The errors you're presenting are occuring at the compilation step for the sketch before any attempt to upload it to your ATTiny via the Uno.  What it tells you is you need to sort out your ATTiny core setup in the IDE first so that pressing the verify button on the IDE results in an error-free compilation.  Once you can get that, the next step will be the programming - which I expect you'll find will be trouble free.

Cheers ! Geoff
32  Using Arduino / Project Guidance / Re: NEED HELP-- Basic Forward and Backward 2.4ghz RC Car on: June 16, 2014, 06:24:02 am
Hi,

That's a very interesting idea.  I'd not thought of using one of these nRF24L01+ modules for a transmitter for RC before, but after a short read found it is a GFSK radio just like that HK GT-2 receiver, and even found this youtube video which pretty much shows a proof of concept for what you're suggesting.

It does seem feasible - have you seen someone else do this before?  There is a lot of chatter over at the RCGroups.com forums about home-grown transmitters.  I got a heap of hits searching for nRF24L01 so hopefully there's good information in there.

All the best with your project,
Geoff
33  Using Arduino / Project Guidance / Re: Arduino/Android/Accelerometer controlled Robot on: June 15, 2014, 04:37:20 pm
and i  dont know which one to use, amarino or mit app inventor? please help me
 with that.
Sorry, I only have experience with MIT app inventor.  All I can tell you about that in a positive way is being based on Scratch, my 10 year old uses it more than I do.  And he's got his tablet doing some pretty useful things as a consequence.

But I'd not get caught up on the tools - if the other says it can do what you need give it a try.  Or try them both.  You'll soon see which you prefer.
34  Using Arduino / Project Guidance / Re: Using GPS 1 PPS to discipline counter to 1 interrupt per second and sync seconds on: June 13, 2014, 09:21:22 pm
Hi,

The part about using the 1 PPS signal to bring your microcontroller's timing back into sync doesn't sound like too difficult a challenge.  Presuming your window is a multiple of seconds away, you can keep track of the error and adjust the "next time" to suit.  This could be done by hooking up your 1PPS line to your Arduino and using a pin change interrupt (link to Nick Gammon's excellent explanation).

I've read elsewhere here that the internal timer in the Arduino can drift a few seconds a day, and it is susceptible to temperature.   So that probably means you'll only have something to do if the GPS loses fix for some hours; and then you'll need to decide whether to round your seconds up or down as the pulse won't tell you anything about the actual time. 

Geoff
35  Using Arduino / Project Guidance / Re: Arduino/Android/Accelerometer controlled Robot on: June 13, 2014, 08:40:24 pm
What robot platform are you intending to use?  Arduino certainly gives you many options for controlling the robot chassis.  After that your question regarding the accelerometer probably needs more information before anyone can respond - are you wanting to design a controller that has an accelerometer in it to send commands to the robot?  This is certainly possible, also with the Arduino.  Often an Android phone or tablet is the choice for this part though, as they have an inbuilt accelerometer and can send commands by bluetooth to a bluetooth receiver for an Arduino in the robot.  Coding for Android is also available online from several free sites (including MIT's App Inventor that I've used), making this an attractive option if you already have a phone/tablet.

Cheers ! Geoff
36  Using Arduino / Project Guidance / Re: Serial data to a Sure ht1632 on: June 12, 2014, 06:43:37 pm
Hi,

Somehow you've ignored what I've been telling you though?  This version is back to storing just the final character in the serial stream, only now as an integer..
Code:
  int serialdata;  //...and then later...

   // when characters arrive over the serial port...
  if (Serial.available()) {
    // store data from serial
 serialdata = (Serial.read ());
  }
So you've reintroduced your original issue, and lost the String object entirely and replaced it with an integer.  Looks like you've taken a big step backwards.
37  Using Arduino / Project Guidance / Re: Serial data to a Sure ht1632 on: June 12, 2014, 05:01:57 am
Good point.  To get it to treat it as a character,
Code:
if (Serial.available()> 0) { msg += char(Serial.read()); }
Also, if there's a chance your information will contain the newline (generated from the enter key) you'll want to avoid storing ASCII 13 & 10, so something like this
Code:
char thisChar;
if (Serial.available()> 0) {
thisChar = Serial.read();
if(thisChar != 10 && thisChar != 13) msg += thisChar;
}

That should get you nearer,
Geoff
38  Using Arduino / Project Guidance / Re: First project: fade up LED then turn on another and fade down both on: June 12, 2014, 04:38:59 am
The delay(5); happens 200 times until it is 80% lit so it is equal to 1 sec, isn't it? I am really new to arduino  and I kinda know delay is never good though
Agreed. My remark was just since the comment and code don't align.

Cheers! Geoff
39  Using Arduino / Project Guidance / Re: Serial data to a Sure ht1632 on: June 11, 2014, 04:28:13 pm
Thanks

I don't have one of those displays handy, but just looking at your logic I'm wondering why you have an array of one String object (msg[1] rather than just delaring a single one.
Code:
// String msg[1]; becomes
String msg;
// and later
  msg = "Welcome";
  msg.toCharArray(final_message,30);
The loop where you load serial data into the String object probably could be as simple as
Code:
  if (Serial.available()> 0) { msg += Serial.read(); }
Unlike an array of characters you don't need to add the new characters at an index in the array, but you can just append them to the end. (note this will grow, and with nothing yet to reset it this will ultimately eat up all your available RAM if there's no mechanism to blank out the message eventually).

Once you've loaded up the String object in that loop, this line should be after the loop
Code:
msg.toCharArray(final_message,30);
That's simply to take what's in that String object, and put it in a character array that you can output to the display.

If you have that working, you can move onto making it scroll - and sorting out the String object so it isn't able to bloat out and use up all your RAM.  You're on the way though.

Cheers ! Geoff
40  Using Arduino / Project Guidance / Re: First project: fade up LED then turn on another and fade down both on: June 11, 2014, 07:58:15 am
Hi,

You'll need to select a PWM capable IO pin for each of your LEDs.  BluePin is using 12 which isn't (presuming you're using an Arduino Uno or similar).  From the AnalogWrite reference page:
Quote
On most Arduino boards (those with the ATmega168 or ATmega328), this function works on pins 3, 5, 6, 9, 10, and 11.
Not quite sure what you're wanting to achieve in the sections below, but the code blocks for when BlueVal is less than 200 is the same as when it's greater than.
Code:
   if (BlueVal < 200)        //over 80%
    {
// the bit in here
    }
    if (BlueVal > 200)       //over 80%
    {
// is exactly the same as the bit in here
    }
Also, in case this next comment was what you wanted to achieve...
Code:
     delay(5);                                        // 1/4 sec
That only pauses the code for 5/1000 sec.  For 1/4 sec delay(250) is what you'd need.  (refer: Delay reference page)

the white one turns on first (I just switched the leads to solve that) -but they both stay on for a really long time after they are both lit.
You'll find white turns on first because you're incrementing the brightness by 5 each loop through (in the code that's WhiteVal+=5), whereas the blue pin is being incremented by 1 (in the code that's BlueVal++).  White will reach 100% brightness 5 times sooner because you've coded it that way.  As a side note, because you only start to dim the LEDs after BlueVal reaches full, at this point WhiteVal will be off the scale (remember 0..255 for analogWrite).  Presently that bit of code will never be reached though - more on that below.
I think it might be due to the switch...
Check your logic.  If the switch is high, you increment the brightness of both LEDs when BlueVal is almost any value (> 200 or <200), but the way I read it, when BlueVal is actually equal to 200 it will have nothing to do.  Your LED brightness will be stuck at 200.  Change one of those tests to >=200 or <=200 so it knows what to do actually at 200.

All the best,
Geoff
41  Using Arduino / Project Guidance / Re: Serial data to a Sure ht1632 on: June 11, 2014, 01:37:39 am
What HT1632 library are you using?  Can you provide the download link?  I have the Adafruit one but can't test your code as it's written for something else I presume? 

Geoff
42  Using Arduino / Project Guidance / Re: First project: fade up LED then turn on another and fade down both on: June 10, 2014, 04:52:41 pm
Why not use the IO pins in the Jeremy Blum tutorial?  You're right, it doesn't go in the power circuit.
43  Using Arduino / Project Guidance / Re: First project: fade up LED then turn on another and fade down both on: June 10, 2014, 09:00:47 am
Hi,

If you've got a few minutes to spare, it's well worth checking out the Arduino tutorials on youtube by Jeremy Blum.  Much of what you need, both the switch logic and changing the brightness of an LED using PWM is covered in the first two videos so you won't have to watch long before you find 80% of what you need for what you're planning.

All the best,
Geoff
44  Using Arduino / Project Guidance / Re: Serial data to a Sure ht1632 on: June 10, 2014, 08:50:53 am
Hi,

I've not tested your code, but the most obvious thing that stands out is you're reading everything from the serial buffer into a single character, here:
Code:
while (Serial.available() > 0)
  // store data from serial
 rotation = (Serial.read ());
When that loop is complete, the final character from the serial buffer is all you've stored since each successive new read overwrites the one before.

You might want to store your buffer into a character array, therefore you'll be able to keep a few characters that you can have displaying on the screen.  You'll need some logic such that as you fill your array it shuffles the characters left.

Hope this helps,
Geoff
45  Using Arduino / Project Guidance / Re: Max number of LED strips per Arduino Mega? on: June 10, 2014, 08:40:20 am
Hi,

There is no limit really - so long as your definition becomes max number of LED strips you can control per Arduino Mega rather than the max you can power from one.

Your Arduino can use MOSFETs, or relays, or shift registers, transistors etc etc to control the brightness or simply switch a LED strip off and on, while the control signals will be measured in thousandths of an Ampere at 5 Volts the LED strips can be independently powered by any source you desire.

Hope that makes sense, Geoff
Pages: 1 2 [3] 4 5 ... 75