You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 15, 2022. It is now read-only.
We should consider some common capabilities of the boards and have a set of interfaces, like PWM capable boards.
Consider current samples for PWM.
Nucleo board:
import'dart:dartino';
import'package:stm32/stm32f411re_nucleo.dart';
import'package:stm32/gpio.dart';
main() {
STM32F411RENucleo nucleo =newSTM32F411RENucleo();
STM32Gpio gpio = nucleo.gpio;
// Initialize all PWM pinsvar pins = [
gpio.initPwmOutput(STM32F411RENucleo.D3),
gpio.initPwmOutput(STM32F411RENucleo.D5),
gpio.initPwmOutput(STM32F411RENucleo.D6),
gpio.initPwmOutput(STM32F411RENucleo.D9),
gpio.initPwmOutput(STM32F411RENucleo.D10),
gpio.initPwmOutput(STM32F411RENucleo.D11)
];
// Set different frequences on each pin.// Note: these that share a timer will share the frequency.for(int i =0; i < pins.length; i++){
pins[i].prescaler = (i +1) *100-1;
pins[i].period =9999;
pins[i].output(i *1000+1000);
}
while(true){
sleep(1);
}
}
And Discovery board:
import'dart:dartino';
import'package:stm32/stm32f746g_disco.dart';
import'package:stm32/gpio.dart';
main() {
STM32F746GDiscovery board =newSTM32F746GDiscovery();
STM32Gpio gpio = board.gpio;
// Initialize all PWM pinsvar pins = [
gpio.initPwmOutput(STM32F746GDiscovery.D3),
gpio.initPwmOutput(STM32F746GDiscovery.D5),
gpio.initPwmOutput(STM32F746GDiscovery.D6),
gpio.initPwmOutput(STM32F746GDiscovery.D9),
gpio.initPwmOutput(STM32F746GDiscovery.D10),
gpio.initPwmOutput(STM32F746GDiscovery.D11)
];
// Set different frequences on each pin.// Note: these that share a timer will share the frequency.for(int i =0; i < pins.length; i++){
pins[i].prescaler = (i +1) *100-1;
pins[i].period =9999;
pins[i].output(i *1000+1000);
}
while(true){
sleep(1);
}
}
The text was updated successfully, but these errors were encountered:
We should consider some common capabilities of the boards and have a set of interfaces, like PWM capable boards.
Consider current samples for PWM.
Nucleo board:
And Discovery board:
The text was updated successfully, but these errors were encountered: