SlideShare ist ein Scribd-Unternehmen logo
1 von 6
Downloaden Sie, um offline zu lesen
Tutorial nº 1
Conhecendo o ambiente de programação
IOTON TECHNOLOGY 1
Site: ioton.cc E-mail: contato@ioton.cc
Tutorial nº 1: Conhecendo o ambiente de programação
A Ioton Technology além da API para utilização dos recursos das placas
Ton e Ton-Fit, também oferece inicialmente suporte ao mbed SDK e ao sistema
operacional de tempo real BRTOS (mais detalhes no blog da Ioton).
Neste momento será apresentado como criar um projeto com a plataforma
Ton. O ambiente nativo da plataforma será com o editor de texto Atom em
conjunto com um package que permite configurar um novo projeto, compilar o
código, enviar para a placa e comunicar via USB. Em breve também serão
apresentadas maneiras de configurar com outros ambientes (e.g., Eclipse IDE).
O desenvolvimento na nuvem por meio do compilador online mbed também
encontra-se em estudo.
 Montagem:
- A seguir o circuito que será utilizado para demonstração.
Tutorial nº 1
Conhecendo o ambiente de programação
IOTON TECHNOLOGY 2
Site: ioton.cc E-mail: contato@ioton.cc
 Passo 1 (criar um novo projeto):
- Na toolbar da ioton, clicar em “New Project” e selecionar a versão da placa.
Tutorial nº 1
Conhecendo o ambiente de programação
IOTON TECHNOLOGY 3
Site: ioton.cc E-mail: contato@ioton.cc
 Passo 2 (seleção dos pinos):
- Selecionar as funções dos pinos (INPUT, OUTPUT, ADC, PWM, UART, ENC
– encoder de quadratura, DAC, I²C, SPI e SDIO).
- Todos os pinos podem ser configurados como entrada ou saída.
- Todas as entradas suportam interrupção externa.
- São 13 pinos de PWM com cinco grupos diferentes (alguns grupos possuem
mais de um canal e são diferenciados pelas letras A, B, C e D). Cada grupo pode
ser configurado com uma frequência diferente.
- A resolução do conversor é de 12-bit ou 10-bit. Neste modo a tensão do pino
não deve exceder 3,3 V.
- Características dos periféricos como frequência do PWM, resolução do ADC e
habilitar interrupção externa, são ajustadas na aba Advanced.
Tutorial nº 1
Conhecendo o ambiente de programação
IOTON TECHNOLOGY 4
Site: ioton.cc E-mail: contato@ioton.cc
 Passo 3 (editar o código):
- Caso no passo anterior não seja selecionado nenhum pino, será criado um
projeto em branco, do contrário é gerado um template com a inicialização dos
periféricos.
- A seguir um código de exemplo para o circuito proposto que controla a
intensidade do LED ligado ao pino 13 e o intervalo entre as cores do LED RGB
da placa:
// Includes ------------------------------------------------------------------
#include "main.h"
// Private variables ---------------------------------------------------------
Ioton ton_fit;
Ticker flipper_1;
PwmOut led_ex(PIN13);
AnalogIn potentiometer(PIN15);
float potentiometerValue = 0.0;
// Flipper 0.1 s - 10 Hz -----------------------------------------------------
void flip_1( void )
{
// Read potentiometer
potentiometerValue = potentiometer;
// Update duty cycle
led_ex = potentiometerValue;
}
Tutorial nº 1
Conhecendo o ambiente de programação
IOTON TECHNOLOGY 5
Site: ioton.cc E-mail: contato@ioton.cc
// ***************************************************************************
// MAIN PROGRAM **************************************************************
int main( void )
{
// Configure function to be attached (flip) and the interval (0.1 second)
flipper_1.attach(&flip_1, 0.1);
// The main LOOP *********************************************************
while (1)
{
// Add your repeated code here
ton_fit.setLED(RED);
wait(potentiometerValue);
ton_fit.setLED(GREEN);
wait(potentiometerValue);
ton_fit.setLED(BLUE);
wait(potentiometerValue);
ton_fit.setLED(YELLOW);
wait(potentiometerValue);
ton_fit.setLED(CYAN);
wait(potentiometerValue);
ton_fit.setLED(MAGENTA);
wait(potentiometerValue);
ton_fit.setLED(WHITE);
wait(potentiometerValue);
ton_fit.setLED(NONE);
wait(potentiometerValue);
} // end of main LOOP
} // end of main function
Tutorial nº 1
Conhecendo o ambiente de programação
IOTON TECHNOLOGY 6
Site: ioton.cc E-mail: contato@ioton.cc
 Passo 4 (enviar para placa):
- Na toolbar da ioton, clicar em “Upload firmware”.
- A placa entra em modo bootloader (DFU) automaticamente, transfere o
firmware e realiza um reset para executar a aplicação.
GitHub: https://github.com/iotontech/tutorial1

Weitere ähnliche Inhalte

Empfohlen

PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...DevGAMM Conference
 

Empfohlen (20)

Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 

Tutorial1 - Ambiente de Programação IOTON

  • 1. Tutorial nº 1 Conhecendo o ambiente de programação IOTON TECHNOLOGY 1 Site: ioton.cc E-mail: contato@ioton.cc Tutorial nº 1: Conhecendo o ambiente de programação A Ioton Technology além da API para utilização dos recursos das placas Ton e Ton-Fit, também oferece inicialmente suporte ao mbed SDK e ao sistema operacional de tempo real BRTOS (mais detalhes no blog da Ioton). Neste momento será apresentado como criar um projeto com a plataforma Ton. O ambiente nativo da plataforma será com o editor de texto Atom em conjunto com um package que permite configurar um novo projeto, compilar o código, enviar para a placa e comunicar via USB. Em breve também serão apresentadas maneiras de configurar com outros ambientes (e.g., Eclipse IDE). O desenvolvimento na nuvem por meio do compilador online mbed também encontra-se em estudo.  Montagem: - A seguir o circuito que será utilizado para demonstração.
  • 2. Tutorial nº 1 Conhecendo o ambiente de programação IOTON TECHNOLOGY 2 Site: ioton.cc E-mail: contato@ioton.cc  Passo 1 (criar um novo projeto): - Na toolbar da ioton, clicar em “New Project” e selecionar a versão da placa.
  • 3. Tutorial nº 1 Conhecendo o ambiente de programação IOTON TECHNOLOGY 3 Site: ioton.cc E-mail: contato@ioton.cc  Passo 2 (seleção dos pinos): - Selecionar as funções dos pinos (INPUT, OUTPUT, ADC, PWM, UART, ENC – encoder de quadratura, DAC, I²C, SPI e SDIO). - Todos os pinos podem ser configurados como entrada ou saída. - Todas as entradas suportam interrupção externa. - São 13 pinos de PWM com cinco grupos diferentes (alguns grupos possuem mais de um canal e são diferenciados pelas letras A, B, C e D). Cada grupo pode ser configurado com uma frequência diferente. - A resolução do conversor é de 12-bit ou 10-bit. Neste modo a tensão do pino não deve exceder 3,3 V. - Características dos periféricos como frequência do PWM, resolução do ADC e habilitar interrupção externa, são ajustadas na aba Advanced.
  • 4. Tutorial nº 1 Conhecendo o ambiente de programação IOTON TECHNOLOGY 4 Site: ioton.cc E-mail: contato@ioton.cc  Passo 3 (editar o código): - Caso no passo anterior não seja selecionado nenhum pino, será criado um projeto em branco, do contrário é gerado um template com a inicialização dos periféricos. - A seguir um código de exemplo para o circuito proposto que controla a intensidade do LED ligado ao pino 13 e o intervalo entre as cores do LED RGB da placa: // Includes ------------------------------------------------------------------ #include "main.h" // Private variables --------------------------------------------------------- Ioton ton_fit; Ticker flipper_1; PwmOut led_ex(PIN13); AnalogIn potentiometer(PIN15); float potentiometerValue = 0.0; // Flipper 0.1 s - 10 Hz ----------------------------------------------------- void flip_1( void ) { // Read potentiometer potentiometerValue = potentiometer; // Update duty cycle led_ex = potentiometerValue; }
  • 5. Tutorial nº 1 Conhecendo o ambiente de programação IOTON TECHNOLOGY 5 Site: ioton.cc E-mail: contato@ioton.cc // *************************************************************************** // MAIN PROGRAM ************************************************************** int main( void ) { // Configure function to be attached (flip) and the interval (0.1 second) flipper_1.attach(&flip_1, 0.1); // The main LOOP ********************************************************* while (1) { // Add your repeated code here ton_fit.setLED(RED); wait(potentiometerValue); ton_fit.setLED(GREEN); wait(potentiometerValue); ton_fit.setLED(BLUE); wait(potentiometerValue); ton_fit.setLED(YELLOW); wait(potentiometerValue); ton_fit.setLED(CYAN); wait(potentiometerValue); ton_fit.setLED(MAGENTA); wait(potentiometerValue); ton_fit.setLED(WHITE); wait(potentiometerValue); ton_fit.setLED(NONE); wait(potentiometerValue); } // end of main LOOP } // end of main function
  • 6. Tutorial nº 1 Conhecendo o ambiente de programação IOTON TECHNOLOGY 6 Site: ioton.cc E-mail: contato@ioton.cc  Passo 4 (enviar para placa): - Na toolbar da ioton, clicar em “Upload firmware”. - A placa entra em modo bootloader (DFU) automaticamente, transfere o firmware e realiza um reset para executar a aplicação. GitHub: https://github.com/iotontech/tutorial1