Posted: Sun May 15, 2016 3:00 pm Post subject: tuto: how to use Arduino-Uno with the same Pin name
Mark suggested me this little tutorial that allows with a very simple file "Arduino-uno - pin.inc" to use the names proposed by Arduino.
I believe that Ben Zijlstra had already made one but I did not found it. (I'm confuse Ben )
This allows to better translate the examples and programs written in C-arduino.
Here the inc file, in the added files 2 samples (ledon/ledoof and the Ds3231 clock using I2C pin)
'------Mark Alberts and J.Pierre Duval 15-05-2016 -----------------------------------
' include file if you want to be close of arduino'pin name
' Remark of Evert : to put the pin in input you have to change PORTX.y in PINX.y
'**************************Arduino names*********************************************
'--------digital-------------------
PIN0 alias portd.0 'take care it is also Rx0
PIN1 alias portd.1 'take care it is also Tx0
PIN2 alias PORTD.2 'int0
PIN3 alias PORTD.3 'int1
PIN4 alias PORTD.4
PIN5 alias PORTD.5
PIN6 alias PORTD.6
PIN7 alias PORTD.7
PIN8 alias PORTB.0
PIN9 alias PORTB.1
PIN10 alias PORTB.2 'SS -----timer1 PWM------- 'this 4 pins are hardware Bus SPI
PIN11 alias PORTB.3 'mosi ---------------------- 'SS (select ship could be another pin)
PIN12 alias PORTB.4 'miso ----------------------
PIN13 alias PORTB.5 'sck----------led arduino---
'--------analogic-------------------
A0 alias PORTC.0
A1 alias PORTC.1
A2 alias PORTC.2
A3 alias PORTC.3
A4 alias PORTC.4
A5 alias PORTC.5
'--------bus I2C------------------- 'with bascom you can use other pins
A_SDA alias PortC.4
A_SCL alias PortC.5
'----------------------------------------------------------------------------------------------------
JP
Last edited by Duval JP on Mon May 16, 2016 11:46 am; edited 1 time in total
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum