Skip to content

Instantly share code, notes, and snippets.

View monpetit's full-sized avatar
💭
I may be slow to respond.

YoungSik Won monpetit

💭
I may be slow to respond.
View GitHub Profile
const int led = 13;
uint32_t count = 0;
// Timer1 output compare A interrupt service routine
ISR(TIMER1_COMPA_vect)
{
// Place your code here
Serial.print("systick = ");
Serial.println(millis());
#define ARRAY_SIZE 30
#define MEASURE_INVERVAL_MS 100
#define REPORT_INVERVAL_MS 5000
const int measurePin = A0;
const int ledPower = 3;
const int samplingTime = 280;
int enablePin = 11;
int in1Pin = 10;
int in2Pin = 9;
boolean dir = false;
int speed = 255;
void setup()
{
pinMode(in1Pin, OUTPUT);
pinMode(in2Pin, OUTPUT);
#include <Stepper.h>
const int steps = 600;
// initialize the stepper library on pins 8 through 11:
Stepper motor(steps, 8, 9, 10, 11);
void setup()
{
#include "em_system.h"
#include "em_emu.h"
#include "em_cmu.h"
#include "em_device.h"
#include "em_chip.h"
#include "em_gpio.h"
#include <stdlib.h>
#include <stdint.h>
/*
Copyright (c) 2012-2014 RedBearLab
Permission is hereby granted, free of charge,
to any person obtaining a copy of this software
and associated documentation files (the "Software"),
to deal in the Software without restriction,
including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense,
#include <stdio.h>
#include <inttypes.h>
#include "em_device.h"
#include "em_chip.h"
#include "em_usart.h"
#include "em_cmu.h"
#include "em_emu.h"
#include "em_adc.h"
/*
Copyright (c) 2016 Ergo Inventus Inc.
Copyright (c) 2012-2014 RedBearLab
Permission is hereby granted, free of charge,
to any person obtaining a copy of this software
and associated documentation files (the "Software"),
to deal in the Software without restriction,
including without limitation the rights
#include <stdio.h>
#include <string.h>
#include <inttypes.h>
#include "em_device.h"
#include "em_chip.h"
#include "em_usart.h"
#include "em_cmu.h"
#include "em_emu.h"
#include <avr/io.h>
#include <util/delay.h>
#include <avr/wdt.h>
#include <avr/sleep.h>
#include <avr/power.h>
ISR(WDT_vect)
{
}