-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathLighting.cpp
More file actions
50 lines (38 loc) · 816 Bytes
/
Lighting.cpp
File metadata and controls
50 lines (38 loc) · 816 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/*
Lighting.cpp - Library for implementing lighting on the OpenLabTools microscope
Written by James Ritchie for OpenLabTools
github.com/OpenLabTools/Microscope
*/
#include "Arduino.h"
#include <Adafruit_NeoPixel.h>
#include "Lighting.h"
#define RING_PIN 12
#define STAGE_LED 11
Adafruit_NeoPixel ring = Adafruit_NeoPixel(16, RING_PIN, NEO_GRB + NEO_KHZ800);
Lighting::Lighting()
{
}
void Lighting::begin()
{
ring.begin();
pinMode(STAGE_LED, OUTPUT);
setStageLEDBrightness(255);
}
void Lighting::loop()
{
ring.show();
}
void Lighting::setRingColour(uint32_t rgb)
{
for(uint16_t i=0;i<16;i++) {
ring.setPixelColor(i, rgb);
}
}
void Lighting::setRingBrightness(uint8_t b)
{
ring.setBrightness(b);
}
void Lighting::setStageLEDBrightness(uint8_t b)
{
//analogWrite(DAC0, b);
}