I think I have a problem.

Pages: 12
@Thumper. Thanks.
I would remark about your RFID project, but I don't quite know what it is. Care to explain?

I am already debouncing the input for my push_button objects. It is done in the push_Button::update() method.

@LB If I may answer. A real contact switch doesn't always change states "clean". There is sometimes a period of a few milliseconds during which the contacts may "bounce" and you will get several open/close signals You do not want to respond to these bounces as though they are several button presses.

One of the beginner tutorials at http://arduino.cc/en/Tutorial/HomePage shows a debouncing example.
Basically, you require that at least 50ms (or so) has passed since the last time the input state has changed before you accept the current state as the stable state.
In the exercise the number of times the button is pressed is displayed to the Serial monitor (a utility which supports serial communication with the board ) and you clearly see the bounces occur when count values get skipped. eg. Press the button once and the count goes from 3 to 6.
The software debounce method clears this problem right up.

EDIT: @Thumper
I may look into the other IDE you recommended soon. I downloaded the New.h and New.cpp files that you linked to then realized I can't #include the class in an arduino IDE project unless I "help" the compiler by supplying a .txt file titled "keywords.txt" in which I declare and classify all keywords which appear in the .h and .cpp files.
In this context "keywords" are of 2 kind: class names and function names.
I would have to prepare such a "keywords.txt" file for New.h and New.cpp, and I am NOT understanding everything I see in those files.
Last edited on
@fun2code
RFID stands for radio frequency identification. In a nutshell, it's a little tag that emits a radio wave key code every time it's activated by an RFID reader. You can buy these little plastic cards that look like hotel keys that are RFID tags (You can also find them in a ton of different form factors like keyfobs or capsules). And most of these are passive RFID tags, which means they don't need a battery to operate. So you have an RFID reader which emits a constant frequency, and when you bring the tag close to the reader the radio waves that are emitted by the reader power the tag just long enough for it to send its serial key via radio wave to the reader. The reader then interprets this and sends the data to (in my case) the Arduino via a serial line for processing.
So i have this reader mounted inside my driver side window by my mirror -- in my car there was this plastic part that hid wires from that went to my side mirror, so i cut a tiny part of it out and fitted the reader into it. Ran some com wires from the reader through my door (alongside the wires from the door locks, and window controls) to underneath my steering column, where I have my Arduino mounted.
So to unlock my car, i swipe my RFID keyfob in front of the reader, the Arduino checks to see if it knows the key, and if so, unlocks my car doors.

Regarding your issue with including the file, if you put it in the library folder you should be able to include it. As I understood, keywords.txt was used by the Arduino IDE for highlighting keywords only.
Also, you're not supposed to understand everything! I don't either. It's just a complete list of EVERY memory allocating mechanism in C++. 99% of which i'll probably never use, but I'm sure the STL takes advantage of them. What's important is in new.cpp:
1
2
3
4
5
6
7
8
9
10
//this is the meat of what's going on there. 
void *operator new(size_t size)
{
    return malloc(size);
} 
void operator delete(void *ptr)
{
    if(ptr)
        free(ptr);
}


But Atmel Studios is really nice. It takes a second to figure out how to configure it, but when you do it's soo much better than the Arduino IDE.
http://www.jayconsystems.com/tutorial/atmerpt1/
That's the tutorial I followed to initially set everything up.
Last edited on
@Thumper: Sounds like a cool project. That makes your car unique.

I want to start doing small motor control, so I have started a project which will be to build a model elevator. The programming and motor control involved in efficiently scheduling stops in response to elevator calls from various floors, then operating the car motors to produce the required motions (including smooth acceleration to/from stops, an ability to creep to a precise position (floor level) ) all seems like a good overall exercise.

I haven't started with any motor operation yet but I currently have a circuit built which correctly supplies power signals for the initial case of responding to one call at a time.

Thanks again for the links and other info.
Is making stuff with arduino hard? I know some easy c++ but not much. I am considering buying one to have something to code, but I don't know how much c++ I must know and if it is beneficial for learning or just a harder path for learning. Please give some thoughts!
~Filip
@fun2code
Yeah, i bought my car used and it didn't come with the typical radio unlocker. To have one installed by the manufacturer would be like $300. I decided to just build an RFID unlocker instead for a quarter of the cost, since i absolutely hated having to use my key to manually unlock my door.

That sounds like a great idea too. If you can get down motor control, you've pretty much got the fundamentals you need to do just about anything with an Arduino. Keep me posted on that project, i'm interested.

@Filiprei
Hard is a really subjective term. To me, it's not at all difficult. It can sometimes be challenging to get things to work the way you want, but that just makes it all the more rewarding.
I think if you bought one it would serve as an incredible learning experience. They add a cool new level to programming; where software meets hardware. After playing with it for a while you'll realize you have a complete new understanding of how technology everywhere works. I used to see a computer as a bunch of vague copper traces and chips that didn't mean anything. Now I see them as microcontrollers and operations that are so very similar to my Arduino projects, and I can wrap my head around how they could come to work. It seems so much more simple than it used to (even though computer circuit design is enormously complex).
I think it's absolutely worth it for you to pick one up. And if you end up not liking it, you're only out about $30-50. It's not like you're taking a gamble on all of your savings. Although i'm sure you'll have a blast with it. I don't see why anyone wouldn't.
Topic archived. No new replies allowed.
Pages: 12