Group 2 PES tuttorial 3 led werkt niet met pot

Dependencies:   FastPWM MODSERIAL mbed HIDScope

main.cpp

Committer:
Roooos
Date:
2018-09-25
Revision:
1:b7fafbf4aa28
Parent:
0:5776e1ab09bd

File content as of revision 1:b7fafbf4aa28:

#include "mbed.h"
#include "MODSERIAL.h"
#include "FastPWM.h"
#include "HIDScope.h"

//DigitalOut ledmbed(LED_RED);
//FastPWM led(D8);
//InterruptIn butt1(D2);
//InterruptIn butt2(D12);
AnalogIn potter(A5);

MODSERIAL pc(USBTX, USBRX);

HIDScope scope(1); // We’re going to send 2 channels of data
Ticker Tikkie;

volatile float brightness;
volatile float brightness_prev = 0;

void ReadPot()
{
    brightness = potter;
    scope.set(0, brightness);
    brightness_prev = brightness;
    scope.send();
}

int main()
{
    Tikkie.attach(&ReadPot,0.01);
    while (true) {};        
}