/** * Pencil sharpening factory * * Author: Jan Dvořák z Vozerovic * E-mail: dvorkaman@gmail.com * Web: dvorkaman.asp2.cz * Created: 2016 */ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "stm32f4xx.h" #include "libSystem.h" #include "libSystemTime.h" #include "libXbeeApi.h" #include "libF4mini.h" #include "libUSART.h" #include "libPWMTone.h" #include "libUtils.h" #include "libSensors.h" #define BELT_SPEED 100 #define BELT_TIME 415 // ms #define BELT_FALL_TIME 750 // ms #define SHARPEN_SPEED 100 #define SHARPEN_BW_TIME 500 #define SHARPEN_FW_SPEED 100 #define SHARPEN_FW_TIME 75 // ms #define SHARPEN_FW_EACH 1500 // each X ms move a bit FW #define SPIKE_DOWN 162 // AN: 37F (inv), updated to 162 manually #define SPIKE_UP 11 // AN: 040 (inv) #define OUT_DOWN 134 // AN: 2FF (inv) #define OUT_UP 61 // AN: 160 (inv) #define OUT_TIME 4000 // ms #define IN_DOWN 95 // belt tilt AN: 21F #define IN_MID 112 // AN: 27F #define IN_UP 118 // AN: 29F #define IN_TIME 500 // ms void processCommand(libRemoteCommandValue cv); void initializePeripherals(void); void clearPeripherals(void); void stateLoop(void);