Giter Site home page Giter Site logo

arduinopromicro-helloworld's Introduction

Initial development for Arduino Pro Micro


Board Arduino Nano
Microcontroller ATmega32U4
USB connector Type-C USB
Digital I/O Pins 12
Analog input pins 4
PWM pins 5
UART RX/TX
I2C A4(SDA), A5(SCL)
SPI D11 (COPI), D12 (CIPO), D13 (SCK)
I/O Voltage 5V
Input voltage (nominal) 5-12V
DC Current per I/O Pin 150 mA
Processor ATmega32U4 16 MHz
Memory 2KB SRAM, 32KB FLASH, 1KB EEPROM

Configuration

Configuring Visual Studio with PlatformIO Extension. Remember to set the platform.ini file with:

[env:sparkfun_promicro16]
platform = atmelavr
board = sparkfun_promicro16
framework = arduino

For this board you will need the SparkFun Lib. You can find it more about it here.

Here you can find a guide for the Arduino IDE

This is a great tutorial as well. Installation Windows and Linux/Mac

If you are using Linux sometimes the device is not recognized in the USB port so you can use the PlatformIO tool to figure it out like this:

When you figure the port out you can add it manually or use this command instead:

pio run --upload-port /dev/ttyACM0

Power Pins

  • RAW is the unregulated voltage input for the Pro Micro. If the board is powered via USB, the voltage at this pin will be about 4.8V (USB's 5V minus a schottkey diode drop). On the other hand, if the board is powered externally, through this pin, the applied voltage can be up to 12V.
  • VCC is the voltage supplied to the on-board ATmega32U4. This voltage will depend on whether you're using a 3.3V/8MHz Pro Micro or a 5V/16MHz version, it'll be either 3.3V or 5V respectively. This voltage is regulated by the voltage applied to the RAW pin. If the board is powered through the 'RAW' pin (or USB), this pin can be used as an output to supply other devices.
  • RST can be used to restart the Pro Micro. This pin is pulled high by a 10k&Ohm; resistor on the board, and is active-low, so it must be connected to ground to initiate a reset. The Pro Micro will remain "off" until the reset line is pulled back to high.
  • GND, of course, is the common, ground voltage (0V reference) for the system.

Hello World

Source

#include <Arduino.h>
int RXLED = 17;  // The RX LED has a defined Arduino pin
// Note: The TX LED was not so lucky, we'll need to use pre-defined
// macros (TXLED1, TXLED0) to control that.
// (We could use the same macros for the RX LED too -- RXLED1,
//  and RXLED0.)

void setup()
{
  pinMode(RXLED, OUTPUT);  // Set RX LED as an output
  // TX LED is set as an output behind the scenes

  Serial.begin(9600); //This pipes to the serial monitor
  Serial.println("Initialize Serial Monitor");

  Serial1.begin(9600); //This is the UART, pipes to sensors attached to board
  Serial1.println("Initialize Serial Hardware UART Pins");
}

void loop()
{
  Serial.println("Hello world!");  // Print "Hello World" to the Serial Monitor
  Serial1.println("Hello! Can anybody hear me?");  // Print "Hello!" over hardware UART

  digitalWrite(RXLED, LOW);   // set the RX LED ON
  TXLED0; //TX LED is not tied to a normally controlled pin so a macro is needed, turn LED OFF
  delay(1000);              // wait for a second

  digitalWrite(RXLED, HIGH);    // set the RX LED OFF
  TXLED1; //TX LED macro to turn LED ON
  delay(1000);              // wait for a second
}

arduinopromicro-helloworld's People

Contributors

andersonkmetiuk avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.