Rev 308 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 308 | Rev 309 | ||
---|---|---|---|
Line 240... | Line 240... | ||
240 | int Data; |
240 | int Data; |
241 | char dontCare; // For a reading we don't care about |
241 | char dontCare; // For a reading we don't care about |
Line 242... | Line 242... | ||
242 | 242 | ||
243 | if (MessungFertig == 0) |
243 | if (MessungFertig == 0) |
244 | { |
244 | { |
Line 245... | Line 245... | ||
245 | PORTD &= ~(1<<PB5); //SS auf low |
245 | PORTD &= ~(1<<PB3); //SS auf low |
246 | 246 | ||
247 | PORTD |= (1<<PB3); //Reset auf high |
247 | PORTD |= (1<<PB8); //Reset auf high |
Line 248... | Line 248... | ||
248 | for(t=0;t<5;t++); //5 Zyklen warten |
248 | for(t=0;t<5;t++); //5 Zyklen warten |
Line 249... | Line 249... | ||
249 | PORTD &= ~(1<<PB3); //Reset auf low |
249 | PORTD &= ~(1<<PB8); //Reset auf low |
250 | 250 | ||
251 | dontCare = (int)spiTransferByte(0x40+axis); // Achse + Mess. Kommando /512 |
251 | dontCare = (int)spiTransferByte(0x40+axis); // Achse + Mess. Kommando /512 |
Line 252... | Line 252... | ||
252 | 252 | ||
253 | PORTD |= (1<<PB5); //SS auf high |
253 | PORTD |= (1<<PB3); //SS auf high |
254 | MessungFertig = 1; |
254 | MessungFertig = 1; |
255 | } |
255 | } |
256 | 256 | ||
257 | if (bit_is_set(PIND,PINB4) && MessungFertig == 1) // Warten bis Messung fertig |
257 | if (bit_is_set(PIND,PINB4) && MessungFertig == 1) // Warten bis Messung fertig |
258 | { |
258 | { |
259 | PORTD &= ~(1<<PB5); //SS auf low |
259 | PORTD &= ~(1<<PB3); //SS auf low |
260 | Data=spiTransferWord(0x00); |
260 | Data=spiTransferWord(0x00); |
261 | PORTD |= (1<<PB5); //SS auf high |
261 | PORTD |= (1<<PB3); //SS auf high |
Line 277... | Line 277... | ||
277 | { |
277 | { |
278 | int t; |
278 | int t; |
279 | int Data=0; |
279 | int Data=0; |
280 | char dontCare; // For a reading we don't care about |
280 | char dontCare; // For a reading we don't care about |
Line 281... | Line 281... | ||
281 | 281 | ||
Line 282... | Line 282... | ||
282 | PORTD &= ~(1<<PB5); //SS auf low |
282 | PORTD &= ~(1<<PB3); //SS auf low |
283 | 283 | ||
284 | PORTD |= (1<<PB3); //Reset auf high |
284 | PORTD |= (1<<PB8); //Reset auf high |
285 | for(t=0;t<5;t++); //5 Zyklen warten |
285 | for(t=0;t<5;t++); //5 Zyklen warten |
Line 286... | Line 286... | ||
286 | PORTD &= ~(1<<PB3); //Reset auf low |
286 | PORTD &= ~(1<<PB8); //Reset auf low |
Line 287... | Line 287... | ||
287 | dontCare = (int)spiTransferByte(0x40+axis); // Achse + Mess. Kommando /512 |
287 | dontCare = (int)spiTransferByte(0x40+axis); // Achse + Mess. Kommando /512 |
Line 288... | Line 288... | ||
288 | 288 | ||
289 | PORTD |= (1<<PB5); //SS auf high |
289 | PORTD |= (1<<PB3); //SS auf high |
290 | 290 | ||
Line 291... | Line 291... | ||
291 | while(!bit_is_set(PIND,PINB4)) // Warten bis Messung fertig |
291 | while(!bit_is_set(PIND,PINB4)) // Warten bis Messung fertig |