Track My Order
Frequently Asked Questions
International Shipping Info
Mon-Fri, 9am to 12pm and
1pm to 5pm U.S. Mountain Time:
Chat With Us
July 26, 2011
News - Genericizing Arduino Libr…
about 3 weeks ago
I just want to thank you for making me feel so young. Nowadays kids ask me questions like “what are punch cards” or even worse… “what was Netscape”.
Yes there are some downsides where you cannot use references. References can’t be set to NULL nor is there such a thing as a “void” reference as there is a void pointer. Passing an array is basically passing a pointer to the first element of the array so that makes no sense to make as a reference.
Also the reference must be set during its instantiation and cannot be changed afterwards unlike a pointer.
Many C++ books have different philosophies on when to use references. Some say use them for passing objects only; others say use them until you can’t.
I am a bit ‘old school’ and tend to still use pointers most of the time.
You wrote “In C and C++ (the Arduino language is really C++) all names that start with an underscore are reserved for use by the compiler”
What conflict? Given that local private variables are local to the class in scope there shouldn’t be any conflict.
Also realize that most registers on Arduoino have no _ in front of them. Imagine if he had declared a variable called TWAR.
You wrote, “Because we’ve passed a pointer (&wirePort) to the library we use arrows instead of dots to access the member functions.”
That isn’t correct.
The definition of your begin method is bool Memory::begin(TwoWire &wirePort), which is taking a reference to the Wire object as an argument, not a pointer.
To pass a pointer your begin method would have looked like this: bool Memory::begin(TwoWire *wirePort). You would have used * instead of an ampersand (&).
The reason you need -> for accessing methods with i2cPort is because you assign the address (pointer) to the Wire object in this line: i2cPort = &wirePort;
“&wirePort” is the address (pointer) to the Wire object.
A different way to achieve this and not use the -> is to treat everything as a reference. Declare i2cPort in Memory.h as TwoWire& i2cPort
Then you can assign i2cPort to the Wire object simply assigning it without the & (i2cPort = wirePort;). All Wire methods after that would be with the normal dot (.) notation: _i2cPort.write();
News - January Caption Contest
about 10 months ago
Who are you who can summon fire without flint or tinder?
about 2 years ago
I’ve used a MAX485 chip to talk to a Mindstorm NXT before over its high speed serial line. This shield looks easier to use since there is no custom code that needs to be written (just use SoftwareSerial) and you can set what your TX/RX pins are with jumpers.
News - Enginursday: Developing o…
about 2 years ago
You need to buy a breakout board. Sparkfun made ones will have a variety to chose from but right now they are mostly on pre-order. There are two Intel break out boards you could get today: the Arduino breakout board and the Mini breakout board. I bought the Arduino breakout board from Makershed and the mini breakout board from Mouser (though I just discovered it is still on backorder).
If you don’t have the Edison yet then order the whole thing from Makershed or Mouser. Mouser has the whole kit (break out with Edison) in stock.
I’ve set up the Eclipse environment under Windows 7 and it works but there are issues. In particular the remote debugging. It started out alright but now it refuses to show me any variable values and often times it just simply refuses to allow me to step through the code. Not at the board at the moment so can’t remember the error it returns.
News - The Edison is Not a Raspb…
about 2 years ago
Everything you said is true for really serious robotic development. I don’t think Intel is targeting that however with the Edison are they? The are more about marketing to IOT and wearables with the Ed (at least that is what I’ve seen on their website).
One thing they both have in common is the lack of documentation (or the disorganized way they post their documentation) when both came out. Seriously the Edison guys confound the masses by first showing how to get the “Blink” sketch to work and then post next step links that are all Native C++ code. Huh? What??
How do you go from Blink to showing IOT development with Eclipse and GDB?
No public wish lists :(
Forgot your password?
No account? Register one!