#include "uart.h"
int main(void)
{
USART2_Init();
test_setup();
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# this won't work, either: | |
# in flask_app: | |
from counter import counter_update, counter_display | |
@app.route('/counter/') | |
def counter(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
As the code is intended for an STM32F0xx board, which requires the peripherals to be defined within the CS, | |
the idea was to have them globally accessible, wrapped in Mutex - RefCell containers. | |
This does not work for the Random Number Generator. Code: | |
static GRNG: Mutex<RefCell<Option<rand::rngs::small::SmallRng>>> = Mutex::new(RefCell::new(None)); | |
gives an error "module 'small' is private". | |
Ideas go go around this and solve the whole problem: three separate timer interrups. |
use std::io;
#[derive(Copy, Clone, Debug)]
struct Record<'a> {
id: u16,
name: &'a str,
quantity: u16,
price: f32,
}
#![no_main]
#![no_std]
extern crate panic_halt;
use cortex_m_rt::entry;
use stm32l0::stm32l0x1;
use stm32l0xx_hal::{
pac,
A simple app to choose a random episode of a TV show :)
extern crate cursive;
use cursive::views::{SelectView, TextView, Dialog};
use cursive::align::*;
use cursive::Cursive;
use cursive::traits::*;
https://en.wikipedia.org/wiki/Sørensen–Dice_coefficient
TO DO: convert to take words as command line arguments with the following syntax: sdcoeff <word1> <word2>
Original quick draft in Python:
def get_bigrams(word):
https://en.wikibooks.org/wiki/Algorithm_Implementation/Sorting/Bubble_sort
Implemented for generic types, as long as they implement Copy and PartialOrd traits.
fn main () {
// example1: numbers
def add(*args):
if len(set([tuple([len(item) for item in arg]) for arg in args])) == 1:
return [[sum(b) for *b, in zip(*item,)] for item in [b for *b, in zip(*args,)]]
else:
use arduino_nano33iot as hal;
use hal::clock::GenericClockController;
use hal::prelude::*;
use rtic::app;
use core::fmt::Write;
use hal::adc::Adc;
#[app(device = crate::hal::pac, peripherals = true)]
OlderNewer