Some things are ready

-Fixed Scroll reducer.
-Some functions were broken down into simpler functions, to facilitate the reading of the code.
-The spanish comments were changed to english
-Some variables like cursera or curseraf now they have names that give meaning to what they are.
This commit is contained in:
sancho11
2019-01-25 19:33:03 -06:00
parent d1eac57362
commit 0d3b249c5a
6 changed files with 1338 additions and 1095 deletions

View File

@@ -3,15 +3,11 @@
*
* Author : Vincenzo
* this works using the unofficial STM32 core, more info: https://github.com/rogerclarkmelbourne/Arduino_STM32
* Led: PB1
*/
#define baudrate 115200 // check if it is the same in processing
#define samples 200 // the number of samples you want to take
#define boardLed PA1
uint16_t initial, state, old_state;
uint16_t pinChanged[samples];
@@ -26,8 +22,8 @@ void setup() {
Serial.begin(baudrate);
pinMode (boardLed, OUTPUT);
digitalWrite(boardLed, LOW);
pinMode (LED_BUILTIN, OUTPUT);
digitalWrite(LED_BUILTIN, LOW);
pinMode(PB0, INPUT_PULLUP);
pinMode(PB1, INPUT_PULLUP);
pinMode(PB2, INPUT_PULLUP);
@@ -54,7 +50,7 @@ void startLA() {
//delay(1000);
event = 0;
digitalWrite(boardLed, HIGH);
digitalWrite(LED_BUILTIN, HIGH);
reset_timer();
initial = GPIOB->regs->IDR;
@@ -86,7 +82,7 @@ void loop() {
}
void sendData() {
digitalWrite(boardLed, LOW);
digitalWrite(LED_BUILTIN, LOW);
//initial data
initial1=initial;