Page 1 of 1

first_sketch_line

Posted: 19 Mar 2017 11:19
by janjoh
So, I have found this error on the forum, but cannot find how it relates to my simple sketch. Any help

Code: Select all

#include "Wire.h"
#include "ZUNO_DS18B20.h"


#define FAN1_PWM_PIN 13
#define FAN1_ENABLE_PIN 26
s_pin FAN1_TACH_PIN = 9;

#define FAN2_PWM_PIN 22
#define FAN2_ENABLE_PIN 27
s_pin FAN2_TACH_PIN = 10;

#define MOSFET1_PWM_PIN 20

#define ONE_WIRE1_PIN 11
#define ONE_WIRE2_PIN 12

ZUNO_SETUP_CHANNELS(
   ZUNO_SENSOR_MULTILEVEL(ZUNO_SENSOR_MULTILEVEL_TYPE_TEMPERATURE, 
                          SENSOR_MULTILEVEL_SCALE_CELSIUS, 
                          SENSOR_MULTILEVEL_SIZE_TWO_BYTES, 
                          SENSOR_MULTILEVEL_PRECISION_ONE_DECIMAL,
                          temp1getter)
);

void setup() {
  pinMode(FAN1_ENABLE_PIN, OUTPUT); 
  pinMode(FAN1_PWM_PIN, OUTPUT); 
  pinMode(FAN1_TACH_PIN, INPUT_PULLUP); 
  pinMode(FAN2_ENABLE_PIN, OUTPUT); 
  pinMode(FAN2_PWM_PIN, OUTPUT); 
  pinMode(FAN2_TACH_PIN, INPUT_PULLUP);
  pinMode(MOSFET1_PWM_PIN, OUTPUT);

  Serial.begin(9600);

  digitalWrite(FAN1_ENABLE_PIN, LOW);
  analogWrite(FAN1_PWM_PIN, 0);
  digitalWrite(FAN2_ENABLE_PIN, LOW);
  analogWrite(FAN2_PWM_PIN, 0);
  analogWrite(MOSFET1_PWM_PIN, 0);
  delay(10000);
}
void loop() {
digitalWrite(FAN1_ENABLE_PIN, HIGH);
 analogWrite(FAN1_PWM_PIN, 10);
 delay(10000);
 analogWrite(FAN1_PWM_PIN, 50);
 delay(10000);
 analogWrite(FAN1_PWM_PIN, 128);
 delay(10000);
 analogWrite(FAN1_PWM_PIN, 255);
 delay(10000);
 digitalWrite(FAN1_ENABLE_PIN, LOW);
 analogWrite(FAN1_PWM_PIN, 0);
 
}

word temp1getter() {
  //NoOp
}


Using library ZUNO_DS18B20 in folder: C:\Users\j2\AppData\Roaming\Arduino15\packages\Z-Uno\hardware\zw8051\2.0.8\libraries\ZUNO_DS18B20 (legacy)

C:\Users\j2\AppData\Roaming\Arduino15\packages\Z-Uno\tools\zuno_toolchain\00.08.30/zuno_toolchain/compiler build C:\Users\j2\AppData\Local\Temp\build8887622240629786535.tmp/TVBankController.cpp -r C:\Users\j2\AppData\Roaming\Arduino15\packages\Z-Uno\hardware\zw8051\2.0.8
Exception:'first_sketch_line'

(<type 'exceptions.KeyError'>, '<string>', 205)
************* Building Arduino Sketch *************
C:\Users\j2\AppData\Local\Temp\build8887622240629786535.tmp/TVBankController.cpp
***************************************************

Preprocessing file: C:\Users\j2\AppData\Local\Temp\build8887622240629786535.tmp\Print.cpp with SDCPP...
Compiling C:\Users\j2\AppData\Local\Temp\build8887622240629786535.tmp\Print_sdcpp_.cpp ...
Preprocessing file: C:\Users\j2\AppData\Local\Temp\build8887622240629786535.tmp\Stream.cpp with SDCPP...
Compiling C:\Users\j2\AppData\Local\Temp\build8887622240629786535.tmp\Stream_sdcpp_.cpp ...
Preprocessing file: C:\Users\j2\AppData\Local\Temp\build8887622240629786535.tmp\Wire.cpp with SDCPP...
Compiling C:\Users\j2\AppData\Local\Temp\build8887622240629786535.tmp\Wire_sdcpp_.cpp ...
Preprocessing file: C:\Users\j2\AppData\Local\Temp\build8887622240629786535.tmp\HLCore.cpp with SDCPP...
Compiling C:\Users\j2\AppData\Local\Temp\build8887622240629786535.tmp\HLCore_sdcpp_.cpp ...
Preprocessing file: C:\Users\j2\AppData\Local\Temp\build8887622240629786535.tmp\HardwareSerial.cpp with SDCPP...
Compiling C:\Users\j2\AppData\Local\Temp\build8887622240629786535.tmp\HardwareSerial_sdcpp_.cpp ...
Preprocessing file: C:\Users\j2\AppData\Local\Temp\build8887622240629786535.tmp\ZUNO_OneWire.cpp with SDCPP...
Compiling C:\Users\j2\AppData\Local\Temp\build8887622240629786535.tmp\ZUNO_OneWire_sdcpp_.cpp ...
Preprocessing file: C:\Users\j2\AppData\Local\Temp\build8887622240629786535.tmp\ZUNO_DS18B20.cpp with SDCPP...
Compiling C:\Users\j2\AppData\Local\Temp\build8887622240629786535.tmp\ZUNO_DS18B20_sdcpp_.cpp ...
Preprocessing file: C:\Users\j2\AppData\Local\Temp\build8887622240629786535.tmp\_TVBankController.cpp with SDCPP...
Compiling C:\Users\j2\AppData\Local\Temp\build8887622240629786535.tmp\_TVBankController_sdcpp_.cpp ...
TVBankController.ino:61:1:warning:control reaches end of non-void functionTraceback (most recent call last):
File "<string>", line 205, in buildFunc
File "C:\tmp\zuno-packager\build\zuno_toolchain-00.08.30-win32\build\compiler\out00-PYZ.pyz\uCxx", line 5473, in compileArduinoSketch
File "C:\tmp\zuno-packager\build\zuno_toolchain-00.08.30-win32\build\compiler\out00-PYZ.pyz\uCxx", line 5206, in compileCPPPhase
File "C:\tmp\zuno-packager\build\zuno_toolchain-00.08.30-win32\build\compiler\out00-PYZ.pyz\uCxx", line 5161, in advancedCompileCXX
File "C:\tmp\zuno-packager\build\zuno_toolchain-00.08.30-win32\build\compiler\out00-PYZ.pyz\uCxx", line 4285, in CompileCXX
File "C:\tmp\zuno-packager\build\zuno_toolchain-00.08.30-win32\build\compiler\out00-PYZ.pyz\uCxx", line 4958, in compilerPrintError
KeyError: 'first_sketch_line'
C:\Users\j2\AppData\Roaming\Arduino15\packages\Z-Uno\tools\zuno_toolchain\00.08.30/zuno_toolchain/compiler returned 2
Error compiling.

Re: first_sketch_line

Posted: 19 Mar 2017 13:40
by PoltoS
In 2.0.9 (still in tests) we have made a meaningfull error message in this case.

In brief, there is no pin 25 nor 26 in Z-Uno ;)

Re: first_sketch_line

Posted: 19 Mar 2017 21:01
by janjoh
PoltoS wrote:In 2.0.9 (still in tests) we have made a meaningfull error message in this case.

In brief, there is no pin 25 nor 26 in Z-Uno ;)
Oh Cr*p.. I used the _physical_ pin numbers, and not the logical ones... *DOH* :)

Re: first_sketch_line

Posted: 20 Mar 2017 23:47
by p0lyg0n1
please add return statement to your getters =)