Arduino Compatibility
Provided by Mark Sproul
- Using Flipper:
- Choose your Penguino AVR then select the Configuration tab
Update so that: BOOTSZ0 is checked, BOOTSZ1 and BOOTRST are unchecked
Go back to the Programming tab, then upload the Arduino Bootloader
Add the provided Arduino Core files to the Arduino software (under hardware/arduino)
- On Mac OS X this is /Applications/Arduino.app/Contents/Resources/Java/hardware
- In the Arduino application:
- From the Tools/Boards menu, select "Arduino - Penguino AVR"
- From Tools/Serial Ports menu, select the penguino serial port (on mac, this will be /dev/cu.penguino-uart)
- When you upload, after clicking the upload button, make sure to press the "RESET" button on the Penguino AVR -- this will load the Arduino-compatible bootloader and let your sketch upload.
Optional, Add penguino-pins.h to your Sketch to use the following aliases:
Arduino Pin |
Penguino AVR Pin |
penguino-pins.h Alias |
Special Notes |
7 |
A0 |
PinA0 |
|
6 |
A1 |
PinA1 |
|
5 |
A2 |
PinA2 |
|
4 |
A3 |
PinA3 |
|
3 |
A4 |
PinA4 |
|
2 |
A5 |
PinA5 |
|
1 |
A6 |
PinA6 |
|
0 |
A7 |
PinA7 |
|
|
|
|
|
8 |
B0 |
PinB0 |
|
9 |
B1 |
PinB1 |
|
10 |
B2 |
PinB2 |
|
11 |
B3 |
PinB3 |
|
12 |
B4 |
PinB4 |
|
13 |
B5 |
PinB5 |
|
14 |
B6 |
PinB6 |
|
15 |
B7 |
PinB7 |
|
|
|
|
|
16 |
C0 |
PinC0 |
|
17 |
C1 |
PinC1 |
|
18 |
D2 |
PinD2 |
|
19 |
D3 |
PinD3 |
|
20 |
D4 |
PinD4 |
|
21 |
D5 |
PinD5 |
|
22 |
D6 |
PinD6 |
|
23 |
D7 |
PinD7 |
|
|
|
|
|
30 |
C6 |
LedGreen |
LED Green (on Board)* |
31 |
C7 |
LedRed |
LED Red (on Board)* |
|
|
|
|
24 |
D0 |
N/A |
UART RxD (internal USB) |
25 |
D1 |
N/A |
UART TxD (internal USB) |
26 |
C2 |
N/A |
JTAG TCK (internal USB) |
27 |
C3 |
N/A |
JTAG TMS (internal USB) |
28 |
C4 |
N/A |
JTAG TDO (internal USB) |
29 |
C5 |
N/A |
JTAG TDI (internal USB) |
*Activate both to turn the LED orange
e.g. The following Arduino Sketch will flash the red status LED on and off:
1 #include "penguino-pins.h"
2
3 void setup() {
4 // initialize the digital pin as an output:
5 pinMode(LedRed, OUTPUT);
6 }
7
8 void loop() {
9 digitalWrite(LedRed, HIGH); // set the LED on
10 delay(1000); // wait for a second
11 digitalWrite(LedRed, LOW); // set the LED off
12 delay(1000); // wait for a second
13 }
![icy [labs]](/moin_static171/common/wikilogo.png)