| Arduino Forum ::  Members :: majenko
 Show Posts Pages: 1 2 [3] 4 5 ... 236
 31 Using Arduino / General Electronics / Re: +12 G -12 = 24 volts? on: December 03, 2013, 08:24:06 am Voltage is measured with respect to some reference point.  This is why it's also known as a potential difference - the difference in voltage between two points.You have an output that is-12V ------- G -------- +12VIf you take G as your "reference point", then you measure the voltages, you get -12V (with respect to G), and +12V (wrtG).  So, mathematically, if G is 0, then -12 = 0 + -120 = 0 + 0+12 = 0 + 12Take one of the other points as your reference point (say -12V) and you can just rearrange the formulae and end up by effectively sliding the scale:0V ------- G ------- +24Vwhere G is now +12V (G + -12V becomes just G as +12 + -12 = 0)0 = 12 + -12+12 = 12 + 0+24 = 12 + 12So as long as G isn't connected to ground in your circuit anywhere else, you can use any of the 3 outputs as your "ground" connection - your "reference point" - and the other two voltages are relative to that, giving you G = 12V and +12V = 24V.BUT if G is also connected to the ground of your circuit through some other means, such as the chassis, then Magic Smoke™ will escape as you are shorting -12V and G.
 32 Using Arduino / Programming Questions / Re: PROGMEM headache !!! Why life is soooo complicated? on: December 03, 2013, 08:09:20 am Quote from: Graynomad on December 03, 2013, 07:57:49 amQuotebut to get it to apartment B3 you have to first send your letter to Geoff in apartment A6 who is friends with Gill in apartment B9.  He will hand the letter to Gill, who can then pass it on to Arthur in apartment B3.GILL!, How embarrassing, I've been calling him Jim.______RobHe was Jim, up until he went for the operation.  Now he's Gill.
 33 Using Arduino / Programming Questions / Re: PROGMEM headache !!! Why life is soooo complicated? on: December 03, 2013, 07:12:27 am Quote from: FTBug on December 03, 2013, 07:07:51 amThank you. This is an excellent explanation of processor architectures!  BTW, real life is certainly more complex than this, since you need cache to access Flash... but it should be more or less transparent to the programmer...  No, you don't "need" cache to access flash.  Cache is often employed when accessing flash as flash access is often slower than RAM access, but it is not a requirement for accessing flash.
 34 Using Arduino / Programming Questions / Re: Error using struct in Arduino C++ on: December 03, 2013, 07:10:33 am If that is all your code, then the assignments you are doing are outside of a function and are invalid.You can't do:Code:int a;a = 3;void setup() {}void loop() {}as the instruction "a = 3;" is a piece of code to be executed, and it can't be executed there.Instead you putCode:int a = 3;which is valid, or in your caseCode:Menu Count_menu = {"", 0, STATE_DATA, 0, MLED_COUNT};with 0 or "" being used for fillers for data I don't know about.
 35 Using Arduino / Programming Questions / Re: Flex sensor and Vibrate program. on: December 03, 2013, 07:04:55 am Well, that will never work, anyway:Code:  sensor = analogRead(0);...  int flexy = analogRead(sensor);