I am using this code to get a digital reading. Now where does that number go? If I am trying to calibrate a FSR, how can I get an alert of the number? Whenever I press the button on the app nothing happens.
- (IBAction)readVariableButtonTapped:(id)sender {
// 1
[[SparkCloud sharedInstance] getDevices:^(NSArray *sparkDevices, NSError *error) {
NSLog(@"%@",sparkDevices.description);
// 2
if (!error)
{
// 3
for (SparkDevice *device in sparkDevices)
{
if ([device.name isEqualToString:@"myDevice"])
{
SparkDevice *myPhoton = device;
// 4
[myPhoton callFunction:@"digitalwrite" withArguments:@[@"D7",@"HIGH"] completion:^(NSNumber *resultCode, NSError *error) {
// 5
if (!error)
{
NSLog(@"Called a function on myDevice");
}
}];
}
}
}
}];
}