Loading...
Pages: 1 [2]   Go Down
Author Topic: Difference code arduino-Pic  (Read 637 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have write the following code for PIC:

Code:
unsigned long la;
void main()
{
  ANSEL  = 0;                     // Configure AN pins as digital
  ANSELH = 0;
  C1ON_bit = 0;                   // Disable comparators
  C2ON_bit = 0;
  la=123;
UART1_Init(9600);
delay_ms(100);
UART1_Write(la);
delay_ms(100);
}

I have tried to print on serial a number with three digits (la=123) and it works...for number with four digits (example la=1234) it doesn't work!!!
The problem is that the serial read and write only one byte to the time....how can i resolve this problem??thanks to all
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 332
Posts: 36396
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I have write the following code for PIC:
Perhaps if you asked your Chevy question at the Chevy shop, not the Ford shop...
Logged

'round the world...
Offline Offline
Edison Member
*
Karma: 21
Posts: 2378
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Well...

You can always run that code on a PC to confirm the arduino is outputting the right answer and ditch the PIC. smiley
Logged

Eu não sou o teu criado. Se respondo no fórum é para ajudar todos mediante a minha disponibilidade e disposição. Responder por mensagem pessoal iria contra o propósito do fórum e por isso evito-o.
Se realmente pretendes que eu te ajude por mensagem pessoal, então podemos chegar a um acordo e contrato onde me pagas pela ajuda que eu fornecer e poderás então definir os termos de confidencialidade do meu serviço. De forma contrária toda e qualquer ajuda que eu der tem de ser visível a todos os participantes do fórum (será boa ideia, veres o significado da palavra fórum).
Nota também que eu não me responsabilizo por parvoíces escritas neste espaço pelo que se vais seguir algo dito por mim, entende que o farás por tua conta e risco.

Dito isto, mensagens pessoais só se forem pessoais, ou seja, se já interagimos de alguma forma no passado ou se me pretendes convidar para uma churrascada com cerveja (paga por ti, obviamente).

Pages: 1 [2]   Go Up
Print
 
Jump to: