Stap 4: Hele structuur van de code van de Arduino
#include
#include "rgb_lcd.h" #include #include
rgb_lcd lcd;
Const int witte [] = {255, 255, 255}; Const int rood [] = {255, 0, 0};
Const int pinRot = A0; Const int pinTemp = a1 worden verkregen; Const int pinIR = A2; Const int pinUV = A3;
Const int pinBut = 7; Const int pinBuz = 8;
Const int tempref = 3975;
int statecount = 0; int tanperc = 0; int tantarg = 0; zweven alltemp [8] = {0, 0, 0, 0, 0, 0, 0, 0}; zweven allIR [8] = {0, 0, 0, 0, 0, 0, 0, 0}; zweven alluv [8] = {0, 0, 0, 0, 0, 0, 0, 0}; int pt = 0; zweven acctemp = 0; zweven accIR = 0; zweven accUV = 0; zweven blootstelling = 0; Const int displayrate = 40; Const int burnrate = 170;
int maxuv = 0; int maxtemp = 0; niet-ondertekende lange starttime = 0; niet-ondertekende lange endtime = 0;
void setup {Serial.begin(9600); lcd.begin (16, 2); lcd.setRGB (wit [0], wit [1], white[2]) lcd.setCursor (0, 0); lcd.print ("Hallo, ik ben uw"); lcd.setCursor (0, 1); lcd.print ("Solmate:)" "); pinMode (pinBut, INPUT); digitalWrite (pinBut, hoge); pinMode (pinBuz, OUTPUT); statecount = 0; delay(4000); setTan(); }
VOID clrRow(int row) {lcd.setCursor (0, rij); lcd.print("");}