Loading...
  Show Posts
Pages: 1 ... 1068 1069 [1070] 1071 1072 ... 1345
16036  Forum 2005-2010 (read only) / Syntax & Programs / Re: Urgent - Split Long into 2 Int using BitShift on: January 20, 2011, 11:07:34 am
Better still, use 65536.  See reply #1

 smiley-wink
16037  Forum 2005-2010 (read only) / Syntax & Programs / Re: Urgent - Split Long into 2 Int using BitShift on: January 20, 2011, 10:32:15 am
You've already posted a bitshift method that works, so why not use it?
16038  Forum 2005-2010 (read only) / Syntax & Programs / Re: Urgent - Split Long into 2 Int using BitShift on: January 20, 2011, 10:16:28 am
It doesn't work.
It may do something, but it isn't correct.
It may help to see the problem if you write 32767 out in hex.
16039  Forum 2005-2010 (read only) / Syntax & Programs / Re: Urgent - Split Long into 2 Int using BitShift on: January 20, 2011, 10:09:02 am

Dividing by 32767 'works good'?
That's where your problem is; your definition of 'good' is flawed.
16040  Forum 2005-2010 (read only) / Syntax & Programs / Re: Any more user friendly way to program sketches? on: January 19, 2011, 12:36:10 pm
No, Ian, I'm not, I'm just saying that the experience an AVR-based Forth offers may not be  the one you're craving.

Try to stick with C - it may yet just 'click'.

It iis easily the most scaleable language I've programmed in, from single device AVRs to mixed architecture CAT scanners with multiple CPUs and DSPs.
16041  Forum 2005-2010 (read only) / Syntax & Programs / Re: Any more user friendly way to program sketches? on: January 19, 2011, 11:04:58 am
It means it works, but probably not in the original spirit of Forth, i.e its interactivity.

Early Forth machines were probably a little more symmetrical, or were even RAM-heavy, meaning applications could developed, the dictionary extended, and eventually commited to ROM.
Long names could easily mean that a RAM-based dictionary could be very rapidly exhausted.

I'd forgotten that Forth doesn't have type checking. Really not good.
16042  Forum 2005-2010 (read only) / Syntax & Programs / Re: Any more user friendly way to program sketches? on: January 19, 2011, 08:10:55 am
Well, there's the RPN and the fact that it doesn't work terrifically well in a RAM-limited Harvard architecture.
16043  Forum 2005-2010 (read only) / Syntax & Programs / Re: Any more user friendly way to program sketches? on: January 19, 2011, 02:54:39 am
I've likened learning to program to learning French - some people take a few classes, get as far as singing 'Sur le pont d'Avignon' and then pick up 'A la recherche du temps perdu' and wonder why they trip up on the first paragraph.
Actually, programming makes things worse by providing libraries, which are a bit like phrase-books, where you can use the language without understanding the principles - great for ordering a beer and croque monsieur, but useless for translating the Gettysburg Address (BT,DT).

Take the time to learn the basics; at least C doesn't have gender and irregular verbs!
16044  Forum 2005-2010 (read only) / Syntax & Programs / Re: Any more user friendly way to program sketches? on: January 18, 2011, 03:25:31 pm
You forgot IBM's attempt - PL/1, or  'when Algol metCOBOL'
16045  Forum 2005-2010 (read only) / Syntax & Programs / Re: Any more user friendly way to program sketches? on: January 18, 2011, 09:03:03 am
Ian,
C was designed as a high-level assembler to aid porting, meant to be close to the machine.
It was never intended for the casual programmer - it would be like handing a loaded gun with the safety off to a toddler.
If there were a sensible cheap alternative, I'm sure it would have been offered for the Arduino.
I've programmed enough different architectures in more than enough assembly languages to know that I'm onto a good thing, and I don't want to go back.

If you want a readable book on C, skip K&R and look at Kelley and Pohl's A Book on C.
Don't ever read Stroupstrup (well, not the first edition anyway)

[edit]FWIW, English is a pretty crappily designed language, and if it weren't for the Yanks adopting it, I'm pretty sure we'd all be speaking French (who, after all, invented everything) or Mandarin. FORTH is good only for those who speak reverse Polish. Or double Dutch. Â
16046  Forum 2005-2010 (read only) / Syntax & Programs / Re: Printing defines on: January 20, 2011, 02:52:33 am
A define is simply a macro; you can apply casts if you like.
, though I don't see how it helps you achieve what you want.
A full implementation of sprintf is a bit OTT for the Arduino.

Somewhere there is an implementation of the more C++ like iostream, I'll see if I can find a link (on a train ATM)
16047  Forum 2005-2010 (read only) / Syntax & Programs / Re: Arduino Serial get Integer on: January 20, 2011, 04:20:24 am
You need to post the code for us to help.
Looks like you're almost there.
16048  Forum 2005-2010 (read only) / Syntax & Programs / Re: Arduino Serial get Integer on: January 17, 2011, 01:11:14 pm
Well, yes there's that, and the 'r' wear due to 'can I reset myArduino by performing a call to the reset vector?'
16049  Forum 2005-2010 (read only) / Syntax & Programs / Re: Arduino Serial get Integer on: January 17, 2011, 12:38:15 pm
This has got to be prime candidate for a sticky thread, hasn't it?
Pretty please.
16050  Forum 2005-2010 (read only) / Syntax & Programs / Re: Auto pilot help needed on: January 16, 2011, 01:48:10 pm
Code:
rudderangleValue = map(rudderangleValue, -180, 1800, 0, 179);    
Is there a zero missing off that -180?

Can I ask why you're using SoftwareServo?
Pages: 1 ... 1068 1069 [1070] 1071 1072 ... 1345